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/728#issuecomment-303794677,https://api.github.com/repos/pydata/xarray/issues/728,303794677,MDEyOklzc3VlQ29tbWVudDMwMzc5NDY3Nw==,1217238,2017-05-24T17:28:21Z,2017-05-24T17:28:21Z,MEMBER,"> Is there a reason inheritance with a different __init__ signature can't be allowed?
No strong reason -- we just didn't really consider (or test) inheritance in the current design. Certainly proposals (and PRs) for a subclassing API would be welcome.
> At the very least, a big fat warning in the documentation would be helpful.
http://xarray.pydata.org/en/stable/internals.html#extending-xarray has some related guidance (I agree it could be louder)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,128980804
https://github.com/pydata/xarray/issues/728#issuecomment-193863403,https://api.github.com/repos/pydata/xarray/issues/728,193863403,MDEyOklzc3VlQ29tbWVudDE5Mzg2MzQwMw==,1217238,2016-03-08T16:53:15Z,2016-03-08T16:53:15Z,MEMBER,"@mathieuS87 I'm not quite sure what you mean there. Do you have a suggested alternative?
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,128980804
https://github.com/pydata/xarray/issues/728#issuecomment-176488063,https://api.github.com/repos/pydata/xarray/issues/728,176488063,MDEyOklzc3VlQ29tbWVudDE3NjQ4ODA2Mw==,1217238,2016-01-29T00:00:08Z,2016-01-29T00:00:08Z,MEMBER,"@rafa-guedes the `__init__` method needs to look like that of DataArray, e.g.,
```
class NewArray(xr.DataArray):
def __init__(self, data, coords=None, dims=None, name=None, attrs=None, encoding=None, fastpath=False):
# ...
```
or even simply:
```
class NewArray(xr.DataArray):
def __init__(self, *args, **kwargs):
# ...
```
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,128980804
https://github.com/pydata/xarray/issues/728#issuecomment-175394725,https://api.github.com/repos/pydata/xarray/issues/728,175394725,MDEyOklzc3VlQ29tbWVudDE3NTM5NDcyNQ==,1217238,2016-01-27T04:47:50Z,2016-01-27T04:47:50Z,MEMBER,"This was definitely caused by the refactor of DataArray internals in 0.7.0.
I don't think you were doing anything wrong, per se, it's just that the internal refactor changed what you can do with a subclasses in an unexpected way :(.
On the plus side, the new code should be better about preserving DataArray subclasses -- new DataArrays should be to the same type as parent objects. However, you will need to preserve the signature of `DataArray.__init__`, or replace the private `_replace` method on your subclass (I don't recommend this, because it's also definitely private API and not guaranteed to continue to work).
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,128980804