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/pull/2956#issuecomment-523232553,https://api.github.com/repos/pydata/xarray/issues/2956,523232553,MDEyOklzc3VlQ29tbWVudDUyMzIzMjU1Mw==,1217238,2019-08-20T23:21:42Z,2019-08-20T23:21:42Z,MEMBER,"You are welcome to continue here or in a new PR, whichever you prefer. I don't have a strong opinion, please do whichever seems easier for you. I think the best examples of complex operations to check for compatibility can be found in `xarray/tests/test_sparse.py` and `xarray/tests/test_dask.py`","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,443157666 https://github.com/pydata/xarray/pull/2956#issuecomment-523225141,https://api.github.com/repos/pydata/xarray/issues/2956,523225141,MDEyOklzc3VlQ29tbWVudDUyMzIyNTE0MQ==,1217238,2019-08-20T22:50:25Z,2019-08-20T22:50:25Z,MEMBER,"> However, the question of whether or not this PR is obsolete now still remains: if one were to replace `quantities` with `pint`, the test checking that this does not work without the proposed changes enabled is the only one that fails. Does pint do `__array_function__` yet? It looks like the answer is ""not yet"" but there's a branch with experimental support: https://github.com/hgrecco/pint/pull/764 We could add the experimental option for allowing subclasses for testing purposes, but ultimately I think we want to insist that objects we use inside `data` implement `__array_function__`, regardless of whether they are a numpy array subclass or duck array. Otherwise there's no way complicated operations like `concat` are going to work properly. I'd love to add tests that verify that xarray can properly wrap arrays with units as soon as possible. We could even merge tests that are all marked ""xfail"" and that currently only pass when using the experimental version of pint from https://github.com/hgrecco/pint/pull/764. As we saw with sparse array support, this will be useful for two reasons: 1. It will help us identify remaining issues that need to be solved either in xarray or in an array-with-units library like pint. 2. There are also likely some subtle tweaks we can do inside xarray to better support arrays with units, e.g., displaying units in the `xarray.Dataset` repr.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,443157666 https://github.com/pydata/xarray/pull/2956#issuecomment-493839144,https://api.github.com/repos/pydata/xarray/issues/2956,493839144,MDEyOklzc3VlQ29tbWVudDQ5MzgzOTE0NA==,1217238,2019-05-20T04:59:16Z,2019-05-20T04:59:16Z,MEMBER,"This looks like a good start to me. So we can start making progress on this, I think it would make sense to hide this behavior behind an option, e.g., `xarray.set_options(enable_experimental_ndarray_subclass_support=True)`. I would consider writing some tests with two of the ndarray subclasses that ship with NumPy: - `np.matrix` - `np.ma.MaskedArray` Both of these subclasses violate some important principles of subclassing, namely they aren't substitutable with objects of their parent class. Thus, I think it would be reasonable to explicitly ""blacklist"" them for use inside in xarray.DataArray. I think we already explicitly convert MaskedArray objects, but perhaps we should also add a check for `np.matrix` objects. In terms of operations, one big class that comes to mind are aggregations, e.g., `.mean()`. It would be good to make sure that these work.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,443157666