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/4221#issuecomment-685920915,https://api.github.com/repos/pydata/xarray/issues/4221,685920915,MDEyOklzc3VlQ29tbWVudDY4NTkyMDkxNQ==,19578931,2020-09-02T18:32:45Z,2020-09-02T18:32:45Z,CONTRIBUTOR,@dcherian No problem! Thanks for all your help!,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-685918128,https://api.github.com/repos/pydata/xarray/issues/4221,685918128,MDEyOklzc3VlQ29tbWVudDY4NTkxODEyOA==,2448579,2020-09-02T18:28:05Z,2020-09-02T18:28:05Z,MEMBER,"Things seem to have died down here so let's test it out.
Thanks @rpmanser This is an amazing first PR. Thanks for your efforts and welcome to xarray!","{""total_count"": 2, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 2, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-684052741,https://api.github.com/repos/pydata/xarray/issues/4221,684052741,MDEyOklzc3VlQ29tbWVudDY4NDA1Mjc0MQ==,19578931,2020-08-31T21:31:51Z,2020-08-31T21:31:51Z,CONTRIBUTOR,"> LGTM. The `reason` for `requires_pint_0_15` would be nice but I don't feel strongly about it so it's up to you.
>
> Thanks for being patient, @rpmanser.
No worries, thanks for the reviews!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-658245353,https://api.github.com/repos/pydata/xarray/issues/4221,658245353,MDEyOklzc3VlQ29tbWVudDY1ODI0NTM1Mw==,24736507,2020-07-14T15:25:43Z,2020-08-31T21:28:02Z,NONE,"Hello @rpmanser! Thanks for updating this PR. We checked the lines you've touched for [PEPĀ 8](https://www.python.org/dev/peps/pep-0008) issues, and found:
There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:
##### Comment last updated at 2020-08-31 21:28:01 UTC","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-682427800,https://api.github.com/repos/pydata/xarray/issues/4221,682427800,MDEyOklzc3VlQ29tbWVudDY4MjQyNzgwMA==,14808389,2020-08-28T09:30:14Z,2020-08-28T09:30:14Z,MEMBER,"you mean the commit message? If so, you can use `git commit --amend` to change it (make sure you don't have anything staged because that would be added to the commit) and force-push. It's not that important, though, I doubt anyone really reads the commit messages.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-682306752,https://api.github.com/repos/pydata/xarray/issues/4221,682306752,MDEyOklzc3VlQ29tbWVudDY4MjMwNjc1Mg==,19578931,2020-08-28T03:37:36Z,2020-08-28T03:37:36Z,CONTRIBUTOR,"I meant `is_duck_array_or_ndarray`, not `is_duck_dask_array_or_ndarray`. I don't suppose there's a way to fix that at this point?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-681982126,https://api.github.com/repos/pydata/xarray/issues/4221,681982126,MDEyOklzc3VlQ29tbWVudDY4MTk4MjEyNg==,14808389,2020-08-27T14:24:14Z,2020-08-27T14:24:14Z,MEMBER,"we went with https://github.com/pydata/xarray/blob/edd5c1e96204d59d30496e3f85e2f805a911ac9b/xarray/core/variable.py#L938 in #4379, you could use something like that here: https://github.com/pydata/xarray/blob/3337b6fc4024dcaa2c11831e6d34551adaee4a8b/xarray/core/formatting.py#L554 too, e.g. with:
```python
def is_duck_array_or_ndarray(array):
return is_duck_array(array) or (not IS_NEP18_ACTIVE and isinstance(data, np.ndarray))
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-681411776,https://api.github.com/repos/pydata/xarray/issues/4221,681411776,MDEyOklzc3VlQ29tbWVudDY4MTQxMTc3Ng==,1217238,2020-08-27T04:37:29Z,2020-08-27T04:37:29Z,MEMBER,"> yes, the failing test is definitely due to NEP18: there's a numpy array in an attribute, but since numpy 1.15 doesn't define `__array_function__`, `is_duck_array` returns `False`. We could extend `is_duck_array` with an `isinstance` check for `numpy.ndarray`, or we could take your suggestion and `xfail` the test. Not sure which is better.
I would suggest adding an explicit check for NumPy arrays. Otherwise we would need to bump our minimum supported NumPy version.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-681188808,https://api.github.com/repos/pydata/xarray/issues/4221,681188808,MDEyOklzc3VlQ29tbWVudDY4MTE4ODgwOA==,14808389,2020-08-27T00:17:12Z,2020-08-27T00:23:49Z,MEMBER,"yes, the failing test is definitely due to NEP18: there's a numpy array in an attribute, but since numpy 1.15 doesn't define `__array_function__`, `is_duck_array` returns `False`. We could extend `is_duck_array` with an `isinstance` check for `numpy.ndarray`, or we could take your suggestion and `xfail` the test. Not sure which is better.
`black` recently released a new version, which changed the way it treats a trailing comma, and it also reformats docstrings (at least as much as it can without breaking formats), but neither `conda` nor the `pre-commit` hook install the new version (yet). To make the diff of this PR as small as possible, I'm opening a new PR with just the automatic changes, once that is merged, it should be fixed by merging in `master`.
Edit: see #4381","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-681182191,https://api.github.com/repos/pydata/xarray/issues/4221,681182191,MDEyOklzc3VlQ29tbWVudDY4MTE4MjE5MQ==,19578931,2020-08-26T23:54:18Z,2020-08-26T23:54:18Z,CONTRIBUTOR,"Tests are failing in `test_formatting.py` for `test_diff_attrs_repr_with_array`. This looks very similar to the previous problem that was occurring for duck array equality due to NEP18. Is a similar xfail appropriate here?
I'm not sure why FormattingBlack failed. It's claiming that 45 files would be reformatted. I used the pre-commit hook, which passed.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-661226607,https://api.github.com/repos/pydata/xarray/issues/4221,661226607,MDEyOklzc3VlQ29tbWVudDY2MTIyNjYwNw==,19578931,2020-07-20T17:35:31Z,2020-07-20T17:35:31Z,CONTRIBUTOR,"I have erred on the side of leaving the `isinstance` checks in place where @jthielen reviewed them. If it is decided that no further tests are needed, then this should be ready for review.
On another note, if it is appropriate to apply these changes:
> > Revisiting it I now realize that `is_array_like` is actually not a good name for that function: officially, ""array_like"" means that it can be casted using `np.asarray`. Maybe we should rename that to `is_duck_array`? But then we'd also need to check for `__array_ufunc__` and `__array_function__` because we also need those to properly wrap duck arrays.
>
> As long as that doesn't break any of the current uses, I think that would be the best way forwards. This would require xarray to be on NumPy 1.16+ (in order to ensure `hasattr(np.ndarray, ""__array_function__"")`, but that's only 9 days away by NEP 29, so hopefully that isn't too much of an issue. Then, most of the checks for ""can this be wrapped by xarray"" should be able to become something like
>
> ```python
> is_duck_array(x) and not isinstance(x, (DataArray, Variable))
> ```
>
> with `is_duck_dask_array` only being needed for checking Dask Array-like support.
I can do that as well. If not, should a new issue be opened for this?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-660192522,https://api.github.com/repos/pydata/xarray/issues/4221,660192522,MDEyOklzc3VlQ29tbWVudDY2MDE5MjUyMg==,2448579,2020-07-17T16:07:20Z,2020-07-17T16:07:20Z,MEMBER,"Thanks for working on this @rpmanser.
Since you've changed every `isinstance` check, if `test_dask` passes, you're doing fine in general.
> Test that a duck dask Array has attributes of a dask Array and redirects the appropriate methods to those defined by Variable, DataArray, and Dataset?
Seems like this is covered by `test_dask` already but I could be wrong.
We could add specific pint-as-dask tests to `test_units` with appropriate xfails (they should run on the `upstream-dev` test config).
This could be a discussion topic for our next dev meeting on wednesday.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-660157829,https://api.github.com/repos/pydata/xarray/issues/4221,660157829,MDEyOklzc3VlQ29tbWVudDY2MDE1NzgyOQ==,3460034,2020-07-17T15:04:50Z,2020-07-17T15:04:50Z,CONTRIBUTOR,"@rpmanser For what it's worth, I'd think doing tests like `test_dask.py` but with a post-https://github.com/hgrecco/pint/pull/1129 Pint Quantity or suitably mocked wrapper class between xarray and Dask would be best. But, I think this is more of a maintainer-level question.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-658946116,https://api.github.com/repos/pydata/xarray/issues/4221,658946116,MDEyOklzc3VlQ29tbWVudDY1ODk0NjExNg==,19578931,2020-07-15T19:01:17Z,2020-07-15T19:01:17Z,CONTRIBUTOR,"I'm getting a bit lost within the testing suite while trying to figure out the implications of this change and what kinds of tests are necessary for it. Would a test module for this
- Individually test all functions that include the newly implemented `is_duck_dask_array()`?
- Test that a duck dask Array has attributes of a dask Array and redirects the appropriate methods to those defined by `Variable`, `DataArray`, and `Dataset`?
- Be similar to `test_dask.py`?
- All, some, or none of the above?
Any suggestions would be greatly appreciated.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-658140708,https://api.github.com/repos/pydata/xarray/issues/4221,658140708,MDEyOklzc3VlQ29tbWVudDY1ODE0MDcwOA==,3460034,2020-07-14T12:03:05Z,2020-07-14T12:03:19Z,CONTRIBUTOR,"> Revisiting it I now realize that `is_array_like` is actually not a good name for that function: officially, ""array_like"" means that it can be casted using `np.asarray`. Maybe we should rename that to `is_duck_array`? But then we'd also need to check for `__array_ufunc__` and `__array_function__` because we also need those to properly wrap duck arrays.
As long as that doesn't break any of the current uses, I think that would be the best way forwards. This would require xarray to be on NumPy 1.16+ (in order to ensure `hasattr(np.ndarray, ""__array_function__"")`, but that's only 9 days away by NEP 29, so hopefully that isn't too much of an issue. Then, most of the checks for ""can this be wrapped by xarray"" should be able to become something like
```python
is_duck_array(x) and not isinstance(x, (DataArray, Variable))
```
with `is_duck_dask_array` only being needed for checking Dask Array-like support.
Although, while we're at it, do we also need more careful handling of upcast types? I'm not sure if there even are any out there right now (not sure if a HoloViews Dataset counts here), but that doesn't necessarily mean there never will be any.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-658130892,https://api.github.com/repos/pydata/xarray/issues/4221,658130892,MDEyOklzc3VlQ29tbWVudDY1ODEzMDg5Mg==,14808389,2020-07-14T11:37:23Z,2020-07-14T11:37:23Z,MEMBER,"Revisiting it I now realize that `is_array_like` is actually not a good name for that function: officially, ""array_like"" means that it can be casted using `np.asarray`. Maybe we should rename that to `is_duck_array`? But then we'd also need to check for `__array_ufunc__` and `__array_function__` because we also need those to properly wrap duck arrays.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384
https://github.com/pydata/xarray/pull/4221#issuecomment-657895835,https://api.github.com/repos/pydata/xarray/issues/4221,657895835,MDEyOklzc3VlQ29tbWVudDY1Nzg5NTgzNQ==,3460034,2020-07-14T00:22:09Z,2020-07-14T00:22:09Z,CONTRIBUTOR,"Also, a broader discussion that's I've seen hinted to in the past, but is brought to the forefront by this PR: how should xarray be checking for general duck array types it can wrap?
Right now, it looks like there is a mix of
```python
is_array_like(data)
```
and
```python
hasattr(data, ""__array_function__"") or isinstance(data, dask_array_type)
```
and it would be nice to bring consistency. However, both these checks seem like they'd let too many types through. For example, `is_array_like` as currently implemented would still let through too much, such as `MemoryCachedArray` and xarray Variables/DataArrays, and `__array_function__` doesn't truly indicate a NumPy duck array on its own (and it really only works to only capture downcast types right now since xarray does not yet implement `__array_function__` itself, #3917).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,656163384