html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/3980#issuecomment-1449013427,https://api.github.com/repos/pydata/xarray/issues/3980,1449013427,IC_kwDOAMm_X85WXjCz,43316012,2023-02-28T22:24:56Z,2023-02-28T22:24:56Z,COLLABORATOR,"I will not be able to join tomorrow, so here are my thoughts on this topic:
- How to work with subclassed Datasets that should return DataArrays? I think the pandas approach is good, we add `Dataset.dataarray_cls = DataArray` and `DataArray.dataset_cls = Dataset` which subclasses can overwrite.
- How to deal with subclasses that change the constructor aka. `__init__`? Probably we need to introduce a kind of shortcut constructor that will be called instead in functions that create new instances (right now the subclass needs the same constructor signature as xarrays version). But then custom instance attributes will not be set etc. Not sure what is the best approach here.
- Is the whole thing limited to DataArrays and Datasets or can one also subclass Variables?","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,602218021
https://github.com/pydata/xarray/issues/3980#issuecomment-1345248318,https://api.github.com/repos/pydata/xarray/issues/3980,1345248318,IC_kwDOAMm_X85QLtw-,43316012,2022-12-10T11:56:02Z,2022-12-10T11:56:02Z,COLLABORATOR,"I think we have made good progress to better support this, only requirement is that the `__init__` method of the subclass has the same syntax as the original xarray implementation.
Maybe in the future we can relax this as well and use a shortcut internally.
The only thing which probably won't work anytime soon is custom Datasets returning custom DataArrays.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,602218021
https://github.com/pydata/xarray/issues/3980#issuecomment-1345247373,https://api.github.com/repos/pydata/xarray/issues/3980,1345247373,IC_kwDOAMm_X85QLtiN,43316012,2022-12-10T11:50:17Z,2022-12-10T11:50:17Z,COLLABORATOR,"> Does xarray have anything like NumPy's [dispatch mechanism](https://numpy.org/doc/stable/user/basics.dispatch.html#basics-dispatch)?
Yes, xarray fully supports this.
","{""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 1, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,602218021