id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 2196272235,PR_kwDOAMm_X85qKODl,8856,Migrate indexing and broadcasting logic to `xarray.namedarray` (Part 1),13301940,open,0,,,0,2024-03-19T23:51:46Z,2024-05-03T17:08:11Z,,MEMBER,,1,pydata/xarray/pulls/8856," This pull request is the first part of migrating the indexing and broadcasting logic from `xarray.core.variable` to `xarray.namedarray`. I intend to open follow-up pull requests to address additional changes related to this refactoring, as outlined in the [proposal for decoupling lazy indexing functionality from NamedArray](https://github.com/pydata/xarray/blob/main/design_notes/named_array_design_doc.md#plan-for-decoupling-lazy-indexing-functionality-from-namedarray). - [ ] Closes #xxxx - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8856/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2203689075,PR_kwDOAMm_X85qjXJq,8870,Enable explicit use of key tuples (instead of *Indexer objects) in indexing adapters and explicitly indexed arrays,13301940,closed,0,,,1,2024-03-23T04:34:18Z,2024-05-03T15:27:38Z,2024-05-03T15:27:22Z,MEMBER,,0,pydata/xarray/pulls/8870," - [ ] Towards #8856 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8870/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2212435865,PR_kwDOAMm_X85rAwYu,8885,add `.oindex` and `.vindex` to `BackendArray`,13301940,closed,0,,,8,2024-03-28T06:14:43Z,2024-04-30T12:12:50Z,2024-04-17T01:53:23Z,MEMBER,,0,pydata/xarray/pulls/8885," this PR builds towards - https://github.com/pydata/xarray/pull/8870 - https://github.com/pydata/xarray/pull/8856 the primary objective is to partially address > 2. Implement fall back `.oindex`, `.vindex` properties on `BackendArray` base class. These will simply rewrap the `key` tuple with the appropriate `*Indexer` object, and pass it on to `__getitem__` or `__setitem__`. These methods will also raise DeprecationWarning so that external backends will know to migrate to `.oindex`, and `.vindex` over the next year. ---- - [ ] Closes #xxxx - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8885/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2231711080,PR_kwDOAMm_X85sCbN-,8921,"Revert `.oindex` and `.vindex` additions in `_ElementwiseFunctionArray`, `NativeEndiannessArray`, and `BoolTypeArray` classes",13301940,open,0,,,9,2024-04-08T17:11:08Z,2024-04-30T06:49:46Z,,MEMBER,,0,pydata/xarray/pulls/8921," As noted in https://github.com/pydata/xarray/issues/8909, the use of `.oindex` and `.vindex` properties in coding/* appears to have broken some backends (e.g. scipy). This PR reverts those changes. We plan to bundle these changes into a separate backends feature branch (see [this comment](https://github.com/pydata/xarray/pull/8885#issuecomment-2036001828), which will be merged once we are confident about its impact on downstream dependencies. - [ ] Closes #8909 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8921/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2203546866,PR_kwDOAMm_X85qi4jp,8869,Handle .oindex and .vindex for the PandasMultiIndexingAdapter and PandasIndexingAdapter,13301940,closed,0,,,0,2024-03-23T00:10:50Z,2024-03-23T02:30:46Z,2024-03-23T02:30:44Z,MEMBER,,0,pydata/xarray/pulls/8869," - [ ] Closes #xxxx - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8869/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2196627659,PR_kwDOAMm_X85qLGOs,8857,increase typing annotations coverage in `xarray/core/indexing.py`,13301940,closed,0,,,0,2024-03-20T04:08:12Z,2024-03-21T01:50:03Z,2024-03-20T20:20:52Z,MEMBER,,0,pydata/xarray/pulls/8857," - [ ] Towards #8856 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8857/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2189661150,PR_kwDOAMm_X85pzxuX,8845,Implement setitem syntax for `.oindex` and `.vindex` properties,13301940,closed,0,,,3,2024-03-16T00:40:46Z,2024-03-19T21:01:45Z,2024-03-19T03:29:58Z,MEMBER,,0,pydata/xarray/pulls/8845,"this is another follow-up to previous Prs - #8780 - #8750 - #8790 , continuing the proposal outlined in [plan for decoupling lazy indexing functionality from NamedArray](https://github.com/pydata/xarray/blob/main/design_notes/named_array_design_doc.md#plan-for-decoupling-lazy-indexing-functionality-from-namedarray) Cc @maxrjones for visibility","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8845/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1958139851,PR_kwDOAMm_X85dlQp4,8364,Migrate from *Indexer objects to `.oindex` and `.vindex` on explicityIndexed array classes,13301940,closed,0,,,1,2023-10-23T22:41:35Z,2024-03-15T23:28:48Z,2024-02-14T23:55:06Z,MEMBER,,1,pydata/xarray/pulls/8364," - [ ] Closes #xxxx - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8364/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2157865512,PR_kwDOAMm_X85oHSTV,8790,Expand use of `.oindex` and `.vindex`,13301940,closed,0,,,4,2024-02-28T00:47:00Z,2024-03-15T23:28:23Z,2024-03-15T05:00:04Z,MEMBER,,0,pydata/xarray/pulls/8790,"this is a follow-up to previous PRs (#8780 and #8750), continuing the efforts outlined in the [plan for decoupling lazy indexing functionality from NamedArray](https://github.com/pydata/xarray/blob/main/design_notes/named_array_design_doc.md#plan-for-decoupling-lazy-indexing-functionality-from-namedarray). the primary focus of this PR is the removal of vectorized and orthogonal indexing logic from the `__getitem__` method. Now, `__getitem__` exclusively handles basic indexers, aligning with points 3 and 4 of the plan: - as per point 3, lazy indexing arrays will now implement `__getitem__` solely for basic indexing. For orthogonal indexing, .oindex will be used, and for vectorized indexing, .vindex will be utilized. - following point 4, IndexingAdapter classes have been updated to consistently implement `__getitem__`, `.oindex`, and `.vindex` - [ ] Closes #xxxx - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8790/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2187291438,PR_kwDOAMm_X85prlwg,8835,[skip-ci] Add dask-expr dependency to doc.yml,13301940,closed,0,,,0,2024-03-14T21:23:24Z,2024-03-14T21:44:18Z,2024-03-14T21:44:14Z,MEMBER,,0,pydata/xarray/pulls/8835,"- #8827 follow up to fix https://readthedocs.org/projects/xray/builds/23743522/ ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8835/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2157624683,I_kwDOAMm_X86Amr1r,8788,CI Failure in Xarray test suite post-Dask tokenization update,13301940,closed,0,6213168,,1,2024-02-27T21:23:48Z,2024-03-01T03:29:52Z,2024-03-01T03:29:52Z,MEMBER,,,,"### What is your issue? Recent changes in Dask's tokenization process (https://github.com/dask/dask/pull/10876) seem to have introduced unexpected behavior in Xarray's test suite. This has led to CI failures, specifically in tests related to tokenization. - https://github.com/pydata/xarray/actions/runs/8069874717/job/22045898877 ```python ---------- coverage: platform linux, python 3.12.2-final-0 ----------- Coverage XML written to file coverage.xml =========================== short test summary info ============================ FAILED xarray/tests/test_dask.py::test_token_identical[obj0-1] - AssertionError: assert 'bbd9679bdaf2...d3db65e29a72d' == '6352792990cf...e8004a9055314' - 6352792990cfe23adb7e8004a9055314 + bbd9679bdaf284c371cd3db65e29a72d FAILED xarray/tests/test_dask.py::test_token_identical[obj0-2] - AssertionError: assert 'bbd9679bdaf2...d3db65e29a72d' == '6352792990cf...e8004a9055314' - 6352792990cfe23adb7e8004a9055314 + bbd9679bdaf284c371cd3db65e29a72d FAILED xarray/tests/test_dask.py::test_token_identical[obj1-1] - AssertionError: assert 'c520b8516da8...0e9e0d02b79d0' == '9e2ab1c44990...6ac737226fa02' - 9e2ab1c44990adb4fb76ac737226fa02 + c520b8516da8b6a98c10e9e0d02b79d0 FAILED xarray/tests/test_dask.py::test_token_identical[obj1-2] - AssertionError: assert 'c520b8516da8...0e9e0d02b79d0' == '9e2ab1c44990...6ac737226fa02' - 9e2ab1c44990adb4fb76ac737226fa02 + c520b8516da8b6a98c10e9e0d02b79d0 = 4 failed, 16293 passed, [628](https://github.com/pydata/xarray/actions/runs/8069874717/job/22045898877#step:9:629) skipped, 90 xfailed, 71 xpassed, 213 warnings in 472.07s (0:07:52) = Error: Process completed with exit code 1. ``` previously, the following code snippet would pass, verifying the consistency of tokenization in Xarray objects: ```python In [1]: import xarray as xr, numpy as np In [2]: def make_da(): ...: da = xr.DataArray( ...: np.ones((10, 20)), ...: dims=[""x"", ""y""], ...: coords={""x"": np.arange(10), ""y"": np.arange(100, 120)}, ...: name=""a"", ...: ).chunk({""x"": 4, ""y"": 5}) ...: da.x.attrs[""long_name""] = ""x"" ...: da.attrs[""test""] = ""test"" ...: da.coords[""c2""] = 0.5 ...: da.coords[""ndcoord""] = da.x * 2 ...: da.coords[""cxy""] = (da.x * da.y).chunk({""x"": 4, ""y"": 5}) ...: ...: return da ...: In [3]: da = make_da() In [4]: import dask.base In [5]: assert dask.base.tokenize(da) == dask.base.tokenize(da.copy(deep=False)) In [6]: assert dask.base.tokenize(da) == dask.base.tokenize(da.copy(deep=True)) In [9]: dask.__version__ Out[9]: '2023.3.0' ``` However, post-update in Dask version '2024.2.1', the same code fails: ```python In [55]: ...: def make_da(): ...: da = xr.DataArray( ...: np.ones((10, 20)), ...: dims=[""x"", ""y""], ...: coords={""x"": np.arange(10), ""y"": np.arange(100, 120)}, ...: name=""a"", ...: ).chunk({""x"": 4, ""y"": 5}) ...: da.x.attrs[""long_name""] = ""x"" ...: da.attrs[""test""] = ""test"" ...: da.coords[""c2""] = 0.5 ...: da.coords[""ndcoord""] = da.x * 2 ...: da.coords[""cxy""] = (da.x * da.y).chunk({""x"": 4, ""y"": 5}) ...: ...: return da ...: In [56]: da = make_da() ``` ```python In [57]: assert dask.base.tokenize(da) == dask.base.tokenize(da.copy(deep=False)) --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) Cell In[57], line 1 ----> 1 assert dask.base.tokenize(da) == dask.base.tokenize(da.copy(deep=False)) AssertionError: In [58]: dask.base.tokenize(da) Out[58]: 'bbd9679bdaf284c371cd3db65e29a72d' In [59]: dask.base.tokenize(da.copy(deep=False)) Out[59]: '6352792990cfe23adb7e8004a9055314' In [61]: dask.__version__ Out[61]: '2024.2.1' ``` additionally, a deeper dive into `dask.base.normalize_token()` across the two Dask versions revealed that the latest version includes additional state or metadata in tokenization that was not present in earlier versions. - old version ```python In [29]: dask.base.normalize_token((type(da), da._variable, da._coords, da._name)) Out[29]: ('tuple', [xarray.core.dataarray.DataArray, ('tuple', [xarray.core.variable.Variable, ('tuple', ['x', 'y']), 'xarray--14cc91345e4b75c769b9032d473f6f6e', ('list', [('tuple', ['test', 'test'])])]), ('list', [('tuple', ['c2', ('tuple', [xarray.core.variable.Variable, ('tuple', []), (0.5, dtype('float64')), ('list', [])])]), ('tuple', ['cxy', ('tuple', [xarray.core.variable.Variable, ('tuple', ['x', 'y']), 'xarray--8e98950eca22c69d304f0a48bc6c2df9', ('list', [])])]), ('tuple', ['ndcoord', ('tuple', [xarray.core.variable.Variable, ('tuple', ['x']), 'xarray-ndcoord-82411ea5e080aa9b9f554554befc2f39', ('list', [])])]), ('tuple', ['x', ('tuple', [xarray.core.variable.IndexVariable, ('tuple', ['x']), ['x', ('603944b9792513fa0c686bb494a66d96c667f879', dtype('int64'), (10,), (8,))], ('list', [('tuple', ['long_name', 'x'])])])]), ('tuple', ['y', ('tuple', [xarray.core.variable.IndexVariable, ('tuple', ['y']), ['y', ('fc411db876ae0f4734dac8b64152d5c6526a537a', dtype('int64'), (20,), (8,))], ('list', [])])])]), 'a']) ``` - most recent version ```python In [44]: dask.base.normalize_token((type(da), da._variable, da._coords, da._name)) Out[44]: ('tuple', [('7b61e7593a274e48', []), ('tuple', [('215b115b265c420c', []), ('tuple', ['x', 'y']), 'xarray--980383b18aab94069bdb02e9e0956184', ('dict', [('tuple', ['test', 'test'])])]), ('dict', [('tuple', ['c2', ('tuple', [('__seen', 2), ('tuple', []), ('6825817183edbca7', ['48cb5e118059da42']), ('dict', [])])]), ('tuple', ['cxy', ('tuple', [('__seen', 2), ('tuple', ['x', 'y']), 'xarray--6babb4e95665a53f34a3e337129d54b5', ('dict', [])])]), ('tuple', ['ndcoord', ('tuple', [('__seen', 2), ('tuple', ['x']), 'xarray-ndcoord-8636fac37e5e6f4401eab2aef399f402', ('dict', [])])]), ('tuple', ['x', ('tuple', [('abc1995cae8530ae', []), ('tuple', ['x']), ['x', ('99b2df4006e7d28a', ['04673d65c892b5ba'])], ('dict', [('tuple', ['long_name', 'x'])])])]), ('tuple', ['y', ('tuple', [('__seen', 25), ('tuple', ['y']), ['y', ('88974ea603e15c49', ['a6c0f2053e85c87e'])], ('dict', [])])])]), 'a']) ``` Cc @dcherian / @crusaderky for visibility ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8788/reactions"", ""total_count"": 2, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 1}",,completed,13221727,issue 2151987948,PR_kwDOAMm_X85nzdLf,8780,introduce `.vindex` property for Explicitly Indexed Arrays,13301940,closed,0,,,0,2024-02-24T00:27:11Z,2024-02-26T21:13:10Z,2024-02-26T21:11:32Z,MEMBER,,0,pydata/xarray/pulls/8780," - [ ] #8750 follow up - [ ] Tests added - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8780/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2135390562,PR_kwDOAMm_X85m6nof,8750,refactor `indexing.py`: introduce `.oindex` for Explicitly Indexed Arrays,13301940,closed,0,,,2,2024-02-14T23:53:53Z,2024-02-23T23:34:44Z,2024-02-23T23:34:43Z,MEMBER,,0,pydata/xarray/pulls/8750," this pull request represents an initial effort to refactor the indexing logic within `indexing.py` by separating it from `variable.py`. to enhance the flexibility of explicitly indexed array classes, this PR introduces orthogonal ~~and vectorized~~ indexing methodsβ€”`.oindex[key]` ~~and `.vindex[key[`~~. these changes are a part of a broader initiative aimed at enabling indexing support for namedarray - [x] Towards https://github.com/pydata/xarray/issues/8238 - [ ] Tests added - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` edit 1: - to minimize the blast radius of this PR, i decided to just focus on `oindex[key]` method in this PR. i intend to introduce `vindex[key]` in a separate PR ## TODO: - [x] https://github.com/pydata/xarray/pull/8750#discussion_r1491169460 - [ ] Enable passing the underlying tuple key","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8750/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2137484840,PR_kwDOAMm_X85nBx-a,8758,refactor DaskIndexingAdapter `__getitem__` method,13301940,closed,0,,,0,2024-02-15T21:31:33Z,2024-02-15T22:50:51Z,2024-02-15T22:44:17Z,MEMBER,,0,pydata/xarray/pulls/8758," this pull request removes the [""unnecessary optimization""](https://github.com/pydata/xarray/issues/8377#issuecomment-1781406355) introduced in https://github.com/pydata/xarray/pull/3588 that attempts to rewrite the indexer key for `BasicIndexer` and `OuterIndexer` - [x] Closes #8377 - [ ] Tests added - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8758/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1852260723,PR_kwDOAMm_X85YA1UQ,8073,"add design document for ""named-array""",13301940,closed,0,,,2,2023-08-15T23:02:36Z,2024-02-12T22:22:33Z,2023-08-17T16:22:48Z,MEMBER,,0,pydata/xarray/pulls/8073,"This PR contains the design document for ""named-array"" a proposed new package aimed at providing a lightweight, efficient array structure with named dimensions. the main objective of named-array is to provide a more accessible version of Xarray's Variable class without the heavy dependencies like Pandas. ~~## proposed name~~ ~~The ""Xarray-lite"" name is a placeholder for the time being. we have considered two main candidates for the package's name: ""narray"" and ""yarray."" feedback on the proposed names or other suggestions is welcome.~~ Related issues: - https://github.com/pydata/xarray/issues/5081 - https://github.com/pydata/xarray/issues/3981","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8073/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1918009494,PR_kwDOAMm_X85beIFo,8250,copy the `dtypes` module to the `namedarray` package.,13301940,closed,0,,,3,2023-09-28T17:52:50Z,2024-02-12T22:22:24Z,2023-10-04T18:14:24Z,MEMBER,,0,pydata/xarray/pulls/8250," this PR copies the `dtypes` module from the `xarray.core` package to the `xarray.namedarray` package. It also recreates the `ReprObject` class from the `utils` module within the `xarray.namedarray` package These changes are part of the ongoing work in: - https://github.com/pydata/xarray/pull/8244 --- - [ ] towards #8238 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8250/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2021745010,PR_kwDOAMm_X85g8efA,8505,roll out the new/refreshed Xarray logo,13301940,closed,0,,,0,2023-12-01T23:53:18Z,2024-02-12T22:22:22Z,2023-12-02T22:42:17Z,MEMBER,,0,pydata/xarray/pulls/8505," - ref: https://github.com/xarray-contrib/xarray.dev/issues/66#issuecomment-1664561089 Cc @jhamman really like how good these look on both light/dark backgrounds: ![Screenshot 2023-12-01 at 16 05 19](https://github.com/pydata/xarray/assets/13301940/11484d91-3eae-466b-a4d6-6794006b6e6c) ![Screenshot 2023-12-01 at 16 05 13](https://github.com/pydata/xarray/assets/13301940/77047c74-f038-4230-8118-539b22ede33b) ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8505/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2115621781,I_kwDOAMm_X85-GdOV,8696,πŸ› compatibility issues with ArrayAPI and SparseAPI Protocols in `namedarray`,13301940,open,0,,,2,2024-02-02T19:27:07Z,2024-02-03T10:55:04Z,,MEMBER,,,,"### What happened? i'm experiencing compatibility issues when using `_arrayfunction_or_api` and `_sparsearrayfunction_or_api` with the sparse arrays with `dtype=object`. specifically, runtime checks using `isinstance` with these protocols are failing, despite the sparse array object appearing to meet the necessary criteria (attributes and methods). ### What did you expect to happen? i expected that since COO arrays from the sparse library provide the necessary attributes and methods, they would pass the `isinstance` checks with the defined protocols. ```python In [56]: from xarray.namedarray._typing import _arrayfunction_or_api, _sparsearrayfunc ...: tion_or_api In [57]: import xarray as xr, sparse, numpy as np, sparse, pandas as pd ``` - numeric dtypes work ```python In [58]: x = np.random.random((10)) In [59]: x[x < 0.9] = 0 In [60]: s = sparse.COO(x) In [61]: isinstance(s, _arrayfunction_or_api) Out[61]: True In [62]: s Out[62]: ``` - string dtypes work ```python In [63]: p = sparse.COO(np.array(['a', 'b'])) In [64]: p Out[64]: In [65]: isinstance(s, _arrayfunction_or_api) Out[65]: True ``` - object dtype doesn't work ```python In [66]: q = sparse.COO(np.array(['a', 'b']).astype(object)) In [67]: isinstance(s, _arrayfunction_or_api) Out[67]: True In [68]: isinstance(q, _arrayfunction_or_api) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:606, in _Elemwise._get_func_coords_data(self, mask) 605 try: --> 606 func_data = self.func(*func_args, dtype=self.dtype, **self.kwargs) 607 except TypeError: TypeError: real() got an unexpected keyword argument 'dtype' During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:611, in _Elemwise._get_func_coords_data(self, mask) 610 out = np.empty(func_args[0].shape, dtype=self.dtype) --> 611 func_data = self.func(*func_args, out=out, **self.kwargs) 612 except TypeError: TypeError: real() got an unexpected keyword argument 'out' During handling of the above exception, another exception occurred: ValueError Traceback (most recent call last) Cell In[68], line 1 ----> 1 isinstance(q, _arrayfunction_or_api) File ~/mambaforge/envs/xarray-tests/lib/python3.9/typing.py:1149, in _ProtocolMeta.__instancecheck__(cls, instance) 1147 return True 1148 if cls._is_protocol: -> 1149 if all(hasattr(instance, attr) and 1150 # All *methods* can be blocked by setting them to None. 1151 (not callable(getattr(cls, attr, None)) or 1152 getattr(instance, attr) is not None) 1153 for attr in _get_protocol_attrs(cls)): 1154 return True 1155 return super().__instancecheck__(instance) File ~/mambaforge/envs/xarray-tests/lib/python3.9/typing.py:1149, in (.0) 1147 return True 1148 if cls._is_protocol: -> 1149 if all(hasattr(instance, attr) and 1150 # All *methods* can be blocked by setting them to None. 1151 (not callable(getattr(cls, attr, None)) or 1152 getattr(instance, attr) is not None) 1153 for attr in _get_protocol_attrs(cls)): 1154 return True 1155 return super().__instancecheck__(instance) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_sparse_array.py:900, in SparseArray.real(self) 875 @property 876 def real(self): 877 """"""The real part of the array. 878 879 Examples (...) 898 numpy.real : NumPy equivalent function. 899 """""" --> 900 return self.__array_ufunc__(np.real, ""__call__"", self) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_sparse_array.py:340, in SparseArray.__array_ufunc__(self, ufunc, method, *inputs, **kwargs) 337 inputs = tuple(reversed(inputs_transformed)) 339 if method == ""__call__"": --> 340 result = elemwise(ufunc, *inputs, **kwargs) 341 elif method == ""reduce"": 342 result = SparseArray._reduce(ufunc, *inputs, **kwargs) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:49, in elemwise(func, *args, **kwargs) 12 def elemwise(func, *args, **kwargs): 13 """""" 14 Apply a function to any number of arguments. 15 (...) 46 it is necessary to convert Numpy arrays to :obj:`COO` objects. 47 """""" ---> 49 return _Elemwise(func, *args, **kwargs).get_result() File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:480, in _Elemwise.get_result(self) 477 if not any(mask): 478 continue --> 480 r = self._get_func_coords_data(mask) 482 if r is not None: 483 coords_list.append(r[0]) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:613, in _Elemwise._get_func_coords_data(self, mask) 611 func_data = self.func(*func_args, out=out, **self.kwargs) 612 except TypeError: --> 613 func_data = self.func(*func_args, **self.kwargs).astype(self.dtype) 615 unmatched_mask = ~equivalent(func_data, self.fill_value) 617 if not unmatched_mask.any(): ValueError: invalid literal for int() with base 10: 'a' In [69]: q Out[69]: ``` the failing case appears to be a well know issue - https://github.com/pydata/sparse/issues/104 ### Minimal Complete Verifiable Example ```Python In [69]: q Out[69]: In [70]: n = xr.NamedArray(data=q, dims=['x']) ``` ### MVCE confirmation - [ ] Minimal example β€” the example is as focused as reasonably possible to demonstrate the underlying issue in xarray. - [ ] Complete example β€” the example is self-contained, including all data and the text of any traceback. - [ ] Verifiable example β€” the example copy & pastes into an IPython prompt or [Binder notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/blank_template.ipynb), returning the result. - [ ] New issue β€” a search of GitHub Issues suggests this is not a duplicate. - [ ] Recent environment β€” the issue occurs with the latest version of xarray and its dependencies. ### Relevant log output ```Python In [71]: n.data Out[71]: In [72]: n Out[72]: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:606, in _Elemwise._get_func_coords_data(self, mask) 605 try: --> 606 func_data = self.func(*func_args, dtype=self.dtype, **self.kwargs) 607 except TypeError: TypeError: real() got an unexpected keyword argument 'dtype' During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:611, in _Elemwise._get_func_coords_data(self, mask) 610 out = np.empty(func_args[0].shape, dtype=self.dtype) --> 611 func_data = self.func(*func_args, out=out, **self.kwargs) 612 except TypeError: TypeError: real() got an unexpected keyword argument 'out' During handling of the above exception, another exception occurred: ValueError Traceback (most recent call last) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/IPython/core/formatters.py:708, in PlainTextFormatter.__call__(self, obj) 701 stream = StringIO() 702 printer = pretty.RepresentationPrinter(stream, self.verbose, 703 self.max_width, self.newline, 704 max_seq_length=self.max_seq_length, 705 singleton_pprinters=self.singleton_printers, 706 type_pprinters=self.type_printers, 707 deferred_pprinters=self.deferred_printers) --> 708 printer.pretty(obj) 709 printer.flush() 710 return stream.getvalue() File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/IPython/lib/pretty.py:410, in RepresentationPrinter.pretty(self, obj) 407 return meth(obj, self, cycle) 408 if cls is not object \ 409 and callable(cls.__dict__.get('__repr__')): --> 410 return _repr_pprint(obj, self, cycle) 412 return _default_pprint(obj, self, cycle) 413 finally: File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/IPython/lib/pretty.py:778, in _repr_pprint(obj, p, cycle) 776 """"""A pprint that just redirects to the normal repr function."""""" 777 # Find newlines and replace them with p.break_() --> 778 output = repr(obj) 779 lines = output.splitlines() 780 with p.group(): File ~/devel/pydata/xarray/xarray/namedarray/core.py:987, in NamedArray.__repr__(self) 986 def __repr__(self) -> str: --> 987 return formatting.array_repr(self) File ~/mambaforge/envs/xarray-tests/lib/python3.9/reprlib.py:21, in recursive_repr..decorating_function..wrapper(self) 19 repr_running.add(key) 20 try: ---> 21 result = user_function(self) 22 finally: 23 repr_running.discard(key) File ~/devel/pydata/xarray/xarray/core/formatting.py:665, in array_repr(arr) 658 name_str = """" 660 if ( 661 isinstance(arr, Variable) 662 or _get_boolean_with_default(""display_expand_data"", default=True) 663 or isinstance(arr.variable._data, MemoryCachedArray) 664 ): --> 665 data_repr = short_data_repr(arr) 666 else: 667 data_repr = inline_variable_array_repr(arr.variable, OPTIONS[""display_width""]) File ~/devel/pydata/xarray/xarray/core/formatting.py:633, in short_data_repr(array) 631 if isinstance(array, np.ndarray): 632 return short_array_repr(array) --> 633 elif isinstance(internal_data, _arrayfunction_or_api): 634 return limit_lines(repr(array.data), limit=40) 635 elif getattr(array, ""_in_memory"", None): File ~/mambaforge/envs/xarray-tests/lib/python3.9/typing.py:1149, in _ProtocolMeta.__instancecheck__(cls, instance) 1147 return True 1148 if cls._is_protocol: -> 1149 if all(hasattr(instance, attr) and 1150 # All *methods* can be blocked by setting them to None. 1151 (not callable(getattr(cls, attr, None)) or 1152 getattr(instance, attr) is not None) 1153 for attr in _get_protocol_attrs(cls)): 1154 return True 1155 return super().__instancecheck__(instance) File ~/mambaforge/envs/xarray-tests/lib/python3.9/typing.py:1149, in (.0) 1147 return True 1148 if cls._is_protocol: -> 1149 if all(hasattr(instance, attr) and 1150 # All *methods* can be blocked by setting them to None. 1151 (not callable(getattr(cls, attr, None)) or 1152 getattr(instance, attr) is not None) 1153 for attr in _get_protocol_attrs(cls)): 1154 return True 1155 return super().__instancecheck__(instance) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_sparse_array.py:900, in SparseArray.real(self) 875 @property 876 def real(self): 877 """"""The real part of the array. 878 879 Examples (...) 898 numpy.real : NumPy equivalent function. 899 """""" --> 900 return self.__array_ufunc__(np.real, ""__call__"", self) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_sparse_array.py:340, in SparseArray.__array_ufunc__(self, ufunc, method, *inputs, **kwargs) 337 inputs = tuple(reversed(inputs_transformed)) 339 if method == ""__call__"": --> 340 result = elemwise(ufunc, *inputs, **kwargs) 341 elif method == ""reduce"": 342 result = SparseArray._reduce(ufunc, *inputs, **kwargs) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:49, in elemwise(func, *args, **kwargs) 12 def elemwise(func, *args, **kwargs): 13 """""" 14 Apply a function to any number of arguments. 15 (...) 46 it is necessary to convert Numpy arrays to :obj:`COO` objects. 47 """""" ---> 49 return _Elemwise(func, *args, **kwargs).get_result() File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:480, in _Elemwise.get_result(self) 477 if not any(mask): 478 continue --> 480 r = self._get_func_coords_data(mask) 482 if r is not None: 483 coords_list.append(r[0]) File ~/mambaforge/envs/xarray-tests/lib/python3.9/site-packages/sparse/_umath.py:613, in _Elemwise._get_func_coords_data(self, mask) 611 func_data = self.func(*func_args, out=out, **self.kwargs) 612 except TypeError: --> 613 func_data = self.func(*func_args, **self.kwargs).astype(self.dtype) 615 unmatched_mask = ~equivalent(func_data, self.fill_value) 617 if not unmatched_mask.any(): ValueError: invalid literal for int() with base 10: 'a' ``` ### Anything else we need to know? i was trying to replace instances of `is_duck_array` with the protocol runtime checks (as part of https://github.com/pydata/xarray/pull/8319), and i've come to a realization that these runtime checks are rigid to accommodate the diverse behaviors of different array types, and `is_duck_array()` the function-based approach might be more manageable. @Illviljan, are there any changes that could be made to both protocols without making them too complex? ### Environment
```python INSTALLED VERSIONS ------------------ commit: 541049f45edeb518a767cb3b23fa53f6045aa508 python: 3.9.18 | packaged by conda-forge | (main, Dec 23 2023, 16:35:41) [Clang 16.0.6 ] python-bits: 64 OS: Darwin OS-release: 23.2.0 machine: arm64 processor: arm byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.14.3 libnetcdf: 4.9.2 xarray: 2024.1.2.dev50+g78dec61f pandas: 2.2.0 numpy: 1.26.3 scipy: 1.12.0 netCDF4: 1.6.5 pydap: installed h5netcdf: 1.3.0 h5py: 3.10.0 Nio: None zarr: 2.16.1 cftime: 1.6.3 nc_time_axis: 1.4.1 iris: 3.7.0 bottleneck: 1.3.7 dask: 2024.1.1 distributed: 2024.1.1 matplotlib: 3.8.2 cartopy: 0.22.0 seaborn: 0.13.2 numbagg: 0.7.1 fsspec: 2023.12.2 cupy: None pint: 0.23 sparse: 0.15.1 flox: 0.9.0 numpy_groupies: 0.9.22 setuptools: 67.7.2 pip: 23.3.2 conda: None pytest: 8.0.0 mypy: 1.8.0 IPython: 8.14.0 sphinx: None ```
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8696/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 2106570846,I_kwDOAMm_X859j7he,8681,CI Failures Associated with Pytest v8.0.0 Release,13301940,closed,0,,,2,2024-01-29T22:45:26Z,2024-01-31T16:53:46Z,2024-01-31T16:53:46Z,MEMBER,,,,"### What is your issue? A recent release of [pytest (v8.0.0)](https://github.com/pytest-dev/pytest/releases) appears to have broken [our CI](https://github.com/pydata/xarray/actions/runs/7701407186/job/20987396814). ```bash pytest 8.0.0 pyhd8ed1ab_0 conda-forge pytest-cov 4.1.0 pyhd8ed1ab_0 conda-forge pytest-env 1.1.3 pyhd8ed1ab_0 conda-forge pytest-github-actions-annotate-failures 0.2.0 pypi_0 pypi pytest-timeout 2.2.0 pyhd8ed1ab_0 conda-forge pytest-xdist 3.5.0 pyhd8ed1ab_0 conda-forge ``` Strangely, the issue doesn't seem to occur when using previous versions (e.g. `v7.4.4`). our [last successful CI](https://github.com/pydata/xarray/actions/runs/7675398082/job/20921573481) run used pytest `v7.4.4` ```bash pytest 7.4.4 pyhd8ed1ab_0 conda-forge pytest-cov 4.1.0 pyhd8ed1ab_0 conda-forge pytest-env 1.1.3 pyhd8ed1ab_0 conda-forge pytest-github-actions-annotate-failures 0.2.0 pypi_0 pypi pytest-timeout 2.2.0 pyhd8ed1ab_0 conda-forge pytest-xdist 3.5.0 pyhd8ed1ab_0 conda-forge ``` i recreated the environment and successfully ran tests locally. the CI failures appear to be connected to the latest release of pytest. i haven't had a chance to do an in-depth exploration of the changes from pytest which could be influencing this disruption. so, i wanted to open an issue to track what is going on. in the meantime, i'm going to pin pytest to an earlier version. any insights, especially from those familiar with changes in the pytest v8.0.0 update, are warmly welcomed.","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8681/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 2106574555,PR_kwDOAMm_X85lYkg9,8682,Fix CI: temporary pin pytest version to 7.4.*,13301940,closed,0,,,1,2024-01-29T22:48:56Z,2024-01-29T23:19:53Z,2024-01-29T23:09:44Z,MEMBER,,0,pydata/xarray/pulls/8682," - [ ] towards fixing #8681 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8682/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1964505426,PR_kwDOAMm_X85d61au,8380,[namedarray] split `.set_dims()` into `.expand_dims()` and `broadcast_to()`,13301940,closed,0,,,17,2023-10-26T23:13:29Z,2024-01-29T19:25:58Z,2024-01-29T19:13:28Z,MEMBER,,0,pydata/xarray/pulls/8380," this is the initial phase of our plan to split the `.set_dims()` method into two distinct methods `.expand_dims()` and `.broadcast_to()` as outlined in the [design document](https://github.com/pydata/xarray/blob/main/design_notes/named_array_design_doc.md). - [x] add `expand_dims()` - [x] add `broadcast_to()` - [x] add `.transpose()` and `.T` to `NamedArray` - [x] update `whats-new.rst`","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8380/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 775502974,MDU6SXNzdWU3NzU1MDI5NzQ=,4738,ENH: Compute hash of xarray objects,13301940,open,0,,,11,2020-12-28T17:18:57Z,2023-12-06T18:24:59Z,,MEMBER,,,," **Is your feature request related to a problem? Please describe.** I'm working on some caching/data-provenance functionality for xarray objects, and I realized that there's no standard/efficient way of computing hashes for xarray objects. **Describe the solution you'd like** It would be useful to have a configurable, reliable/standard `.hexdigest()` method on xarray objects. For example, zarr provides a digest method that returns you a digest/hash of the data. ```python In [16]: import zarr In [17]: z = zarr.zeros(shape=(10000, 10000), chunks=(1000, 1000)) In [18]: z.hexdigest() # uses sha1 by default for speed Out[18]: '7162d416d26a68063b66ed1f30e0a866e4abed60' In [20]: z.hexdigest(hashname='sha256') Out[20]: '46fc6e52fc1384e37cead747075f55201667dd539e4e72d0f372eb45abdcb2aa' ``` I'm thinking that an xarray's built-in hashing mechanism would provide a more reliable way to treat metadata such as global attributes, encoding, etc... during the hash computation... **Describe alternatives you've considered** So far, I am using joblib's default hasher: `joblib.hash()` function. However, I am in favor of having a configurable/built-in hasher that is aware of xarray's data model and quirks :) ```python In [1]: import joblib In [2]: import xarray as xr In [3]: ds = xr.tutorial.open_dataset('rasm') In [5]: joblib.hash(ds, hash_name='sha1') Out[5]: '3e5e3f56daf81e9e04a94a3dff9fdca9638c36cf' In [8]: ds.attrs = {} In [9]: joblib.hash(ds, hash_name='sha1') Out[9]: 'daab25fe735657e76514040608fadc67067d90a0' ``` **Additional context** Add any other context about the feature request here. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4738/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 2024719599,PR_kwDOAMm_X85hGcWv,8519,[skip-ci] fix RTD docs build,13301940,closed,0,,,1,2023-12-04T20:56:34Z,2023-12-04T21:08:49Z,2023-12-04T21:04:47Z,MEMBER,,0,pydata/xarray/pulls/8519," ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8519/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 768981497,MDExOlB1bGxSZXF1ZXN0NTQxMjMxNjc0,4700,Raise an informative error message when object array has mixed types,13301940,closed,0,,,10,2020-12-16T15:07:21Z,2023-11-28T22:19:02Z,2023-11-28T22:19:00Z,MEMBER,,0,pydata/xarray/pulls/4700," - [x] Closes #2620 - [x] Tests added - [x] Passes `isort . && black . && mypy . && flake8` - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4700/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1959903578,PR_kwDOAMm_X85drMmv,8369,fix `NamedArray.imag` and `NamedArray.real` typing info,13301940,closed,0,,,4,2023-10-24T19:06:48Z,2023-10-25T19:17:55Z,2023-10-25T19:17:53Z,MEMBER,,0,pydata/xarray/pulls/8369," - [ ] #8365 follow up - [ ] Tests added","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8369/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1958381131,PR_kwDOAMm_X85dmDe9,8365,add `.imag` and `.real` properties to `NamedArray`,13301940,closed,0,,,1,2023-10-24T02:55:30Z,2023-10-24T18:19:12Z,2023-10-24T10:53:58Z,MEMBER,,0,pydata/xarray/pulls/8365," ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8365/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1916603412,PR_kwDOAMm_X85bZS7E,8244,Migrate VariableArithmetic to NamedArrayArithmetic,13301940,open,0,,,6,2023-09-28T02:29:15Z,2023-10-11T17:03:02Z,,MEMBER,,1,pydata/xarray/pulls/8244," - [ ] towards #8238 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8244/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1854145928,PR_kwDOAMm_X85YHMlg,8075,initial refactor for NamedArray,13301940,closed,0,,,17,2023-08-17T02:37:37Z,2023-09-27T15:35:13Z,2023-09-27T15:23:21Z,MEMBER,,0,pydata/xarray/pulls/8075," this pull request introduces the initial prototype for `NamedArray` as discussed in issue #8073. the intention is to approach the implementation in multiple phases through separate pull requests. the main objectives of this PR are as follows: 1. creation of a new class, `xarray.named_array.NamedArray`, which will encompass most of the necessary functionality for the lightweight version of `xarray.Variable`. As a result, `xarray.Variable` will inherit from this class and implement specific functionality related to xarray. 2. removal of all imports of internal Xarray classes and utilities from the `xarray.named_array` sub-package. the aim is to eliminate dependencies on anything within `xarray.core`. This will facilitate the future goal of moving `named_array` into its own standalone package, with `xarray` then depending on it. - [ ] Towards #3981 - [x] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8075/reactions"", ""total_count"": 3, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 3, ""eyes"": 0}",,,13221727,pull 1903416932,I_kwDOAMm_X85xc9Zk,8210,Inconsistent Type Hinting for dims Parameter in xarray Methods,13301940,open,0,,,7,2023-09-19T17:15:43Z,2023-09-20T15:03:45Z,,MEMBER,,,,"`None` is not really practical in current xarray so not allowing it as a dimension is probably the easiest path, but type hinting will not be correct. I want `dims` to have a type hint that is consistent, easy to read and understand. In a dream world it would look something like this: ```python InputDim = Hashable # Single dimension InputDims = Iterable[InputDim , ...] # multiple dimensions InputDimOrDims = Union[InputDim, InputDims] # Single or multiple dimensions ``` Then we can easily go through our xarray methods and easily replace `dim` and `dims` arguments. `Hashable` could be fine in `NamedArray`, we haven't introduced `None` as a typical default value there yet. But it wouldn't be easy in xarray because we use `None` as default value a lot, which will (I suspect) lead to a bunch of refactoring and deprecations. I haven't tried it maybe it's doable? Another idea is to try and make a HashableExcludingNone: ```python HashableExcludingNone = Union[int, str, tuple, ...] # How many more Hashables are there? InputDim = HashableExcludingNone # Single dimension InputDims = Iterable[InputDim , ...] # multiple dimensions InputDimOrDims = Union[InputDim, InputDims] # Single or multiple dimensions ``` I suspect this is harder than it seems. Another idea is drop the idea of Hashable and just allow a few common ones that are used: ```python InputDim = str # Single dimension InputDims = tuple[InputDim , ...] # multiple dimensions InputDimOrDims = Union[InputDim, InputDims] # Single or multiple dimensions ``` Very clear! I think a few users (and maintainers) will be sad because of the lack of flexibility though. No easy paths, and trying to be backwards compatible is very demotivating. _Originally posted by @Illviljan in https://github.com/pydata/xarray/pull/8075#discussion_r1330437962_ ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8210/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 1251404616,PR_kwDOAMm_X844ndTA,6650,import `cleanup` fixture from `distributed`,13301940,closed,0,,,1,2022-05-28T01:39:42Z,2023-06-16T22:52:29Z,2022-05-29T13:10:52Z,MEMBER,,0,pydata/xarray/pulls/6650," - [x] Closes #6649 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6650/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 870619014,MDExOlB1bGxSZXF1ZXN0NjI1Nzg2MTY2,5234,Code cleanup,13301940,closed,0,,,14,2021-04-29T05:16:02Z,2023-06-16T22:52:27Z,2021-05-13T16:37:15Z,MEMBER,,0,pydata/xarray/pulls/5234," This PR introduces small changes to enhance code maintainability... - [x] Passes `pre-commit run --all-files` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5234/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 856020853,MDExOlB1bGxSZXF1ZXN0NjEzNjY3MDQx,5142,Trigger CI on push or pull_request but not both,13301940,closed,0,,,2,2021-04-12T14:12:29Z,2023-06-16T22:52:19Z,2022-01-20T01:51:10Z,MEMBER,,0,pydata/xarray/pulls/5142," - [ ] Addresses https://github.com/pydata/xarray/pull/5139#issuecomment-817362317 - [x] Passes `pre-commit run --all-files` Here's a snippet of how this looks like when a pull request is created on the same main repository: Cc @keewis ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5142/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 539394615,MDExOlB1bGxSZXF1ZXN0MzU0Mzc5Nzk2,3640,Add entrypoint for plotting backends,13301940,closed,0,,,14,2019-12-18T01:11:08Z,2023-06-16T22:52:17Z,2021-09-26T21:53:42Z,MEMBER,,1,pydata/xarray/pulls/3640," Libraries, including `xarray`, register backends via `entrypoints`. Xarray adds an EntryPoint ""group"" in its `setup.py`. Third party libraries add items to that group in their `setup.pys`. Xarray and the third-party library don't need to talk to each other directly to register a backend. They talk through `pkg_resources`. For instance, `hvplot/holoviews` would add an EntryPoint for `xarray_plotting_backends` in its setup.py: ```python entry_points={""xarray_plotting_backends"": ['holoviews = hvplot:plotting']} ``` and xarray users should be able to achieve what @jsignell proposed in #3553: > ```python > import xarray as xr > air = xr.tutorial.open_dataset('air_temperature').load().air > xr.set_options(plotting_backend='holoviews') > > air.isel(time=500).plot() > ``` > > - [ ] Closes #3553 - [x] Tests added - [x] Passes `black . && mypy . && flake8` - [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3640/reactions"", ""total_count"": 2, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 2, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1755311785,PR_kwDOAMm_X85S6P0H,7917,Ensure dtype of reindex result matches dtype of the original DataArray,13301940,closed,0,,,0,2023-06-13T16:55:38Z,2023-06-16T22:51:46Z,2023-06-16T03:10:23Z,MEMBER,,0,pydata/xarray/pulls/7917," - [x] Closes #7299 - [x] Tests added - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/7917/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1380118553,PR_kwDOAMm_X84_T6Nz,7061,Remove team page from docs and link to https://xarray.dev/team,13301940,closed,0,,,1,2022-09-20T23:51:19Z,2022-10-06T18:08:30Z,2022-10-06T18:08:28Z,MEMBER,,0,pydata/xarray/pulls/7061," This PR removes the existing team page from the docs and links to the newly created https://xarray.dev/team on the landing page ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/7061/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1330592136,PR_kwDOAMm_X848v_oP,6885,Fix documentation builds,13301940,closed,0,,,0,2022-08-06T00:39:38Z,2022-08-06T00:56:01Z,2022-08-06T00:55:52Z,MEMBER,,0,pydata/xarray/pulls/6885," - [ ] Addresses https://github.com/pydata/xarray/pull/6884#issuecomment-1207094758 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6885/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1254335146,PR_kwDOAMm_X844w-ab,6655,Fix notebooks' HTML links,13301940,closed,0,,,0,2022-05-31T19:33:45Z,2022-05-31T19:52:45Z,2022-05-31T19:52:43Z,MEMBER,,0,pydata/xarray/pulls/6655," - [ ] #6530 follow-up ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6655/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 978356586,MDExOlB1bGxSZXF1ZXN0NzE4OTU4Mzc1,5734,Enable `flox` in `GroupBy` and `resample`,13301940,closed,0,,,25,2021-08-24T18:09:28Z,2022-05-15T03:33:49Z,2022-05-15T02:38:29Z,MEMBER,,0,pydata/xarray/pulls/5734," This PR supersedes https://github.com/pydata/xarray/pull/4540. This is still a very rough draft :) - Closes - [x] Closes #4473 - [x] Closes #4498 - [x] Closes #659 - [x] Closes #2237 - [x] xref https://github.com/pangeo-data/pangeo/issues/271 - [x] Tests added - [x] Passes `pre-commit run --all-files` - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` TODO: - [x] flox vs legacy tests with nans - [x] test passing flox-specific kwargs like engine and method.","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5734/reactions"", ""total_count"": 8, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 8, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 576502871,MDU6SXNzdWU1NzY1MDI4NzE=,3834,encode_cf_datetime() casts dask arrays to NumPy arrays,13301940,open,0,,,2,2020-03-05T20:11:37Z,2022-04-09T03:10:49Z,,MEMBER,,,," Currently, when `xarray.coding.times.encode_cf_datetime()` is called, it always casts the input to a NumPy array. This is not what I would expect when the input is a dask array. I am wondering if we could make this operation lazy when the input is a dask array? https://github.com/pydata/xarray/blob/01462d65c7213e5e1cddf36492c6a34a7e53ce55/xarray/coding/times.py#L352-L354 ```python In [46]: import numpy as np In [47]: import xarray as xr In [48]: import pandas as pd In [49]: times = pd.date_range(""2000-01-01"", ""2001-01-01"", periods=11) In [50]: time_bounds = np.vstack((times[:-1], times[1:])).T In [51]: arr = xr.DataArray(time_bounds).chunk() In [52]: arr Out[52]: dask.array, shape=(10, 2), dtype=datetime64[ns], chunksize=(10, 2), chunktype=numpy.ndarray> Dimensions without coordinates: dim_0, dim_1 In [53]: xr.coding.times.encode_cf_datetime(arr) Out[53]: (array([[ 0, 52704], [ 52704, 105408], [105408, 158112], [158112, 210816], [210816, 263520], [263520, 316224], [316224, 368928], [368928, 421632], [421632, 474336], [474336, 527040]]), 'minutes since 2000-01-01 00:00:00', 'proleptic_gregorian') ``` Cc @jhamman ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3834/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 653442225,MDU6SXNzdWU2NTM0NDIyMjU=,4209,`xr.save_mfdataset()` doesn't honor `compute=False` argument,13301940,open,0,,,4,2020-07-08T16:40:11Z,2022-04-09T01:25:56Z,,MEMBER,,,," **What happened**: While using `xr.save_mfdataset()` function with `compute=False` I noticed that the function returns a `dask.delayed` object, but **it doesn't actually defer the computation** i.e. it actually writes datasets right away. **What you expected to happen**: I expect the datasets to be written when I explicitly call `.compute()` on the returned delayed object. **Minimal Complete Verifiable Example**: ```python In [2]: import xarray as xr In [3]: ds = xr.tutorial.open_dataset('rasm', chunks={}) In [4]: ds Out[4]: Dimensions: (time: 36, x: 275, y: 205) Coordinates: * time (time) object 1980-09-16 12:00:00 ... 1983-08-17 00:00:00 xc (y, x) float64 dask.array yc (y, x) float64 dask.array Dimensions without coordinates: x, y Data variables: Tair (time, y, x) float64 dask.array Attributes: title: /workspace/jhamman/processed/R1002RBRxaaa01a/l... institution: U.W. source: RACM R1002RBRxaaa01a output_frequency: daily output_mode: averaged convention: CF-1.4 references: Based on the initial model of Liang et al., 19... comment: Output from the Variable Infiltration Capacity... nco_openmp_thread_number: 1 NCO: ""4.6.0"" history: Tue Dec 27 14:15:22 2016: ncatted -a dimension... In [5]: path = ""test.nc"" In [7]: ls -ltrh test.nc ls: cannot access test.nc: No such file or directory In [8]: tasks = xr.save_mfdataset(datasets=[ds], paths=[path], compute=False) In [9]: tasks Out[9]: Delayed('list-aa0b52e0-e909-4e65-849f-74526d137542') In [10]: ls -ltrh test.nc -rw-r--r-- 1 abanihi ncar 14K Jul 8 10:29 test.nc ``` **Anything else we need to know?**: **Environment**:
Output of xr.show_versions() ```python INSTALLED VERSIONS ------------------ commit: None python: 3.7.6 | packaged by conda-forge | (default, Jun 1 2020, 18:57:50) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 3.10.0-693.21.1.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_US.UTF-8 LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.1 pandas: 0.25.3 numpy: 1.18.5 scipy: 1.5.0 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.2.0 nc_time_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.20.0 distributed: 2.20.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None setuptools: 49.1.0.post20200704 pip: 20.1.1 conda: None pytest: None IPython: 7.16.1 sphinx: None ```
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4209/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 1035640211,I_kwDOAMm_X849up2T,5898,Update docs for Dataset `reduce` methods to indicate that non-numeric data variables are dropped,13301940,closed,0,,,2,2021-10-25T22:48:49Z,2022-03-12T08:17:48Z,2022-03-12T08:17:48Z,MEMBER,,,,"`xr.Dataset` reduce methods such as mean drop non-numeric data variables prior to the reduction. However, as far as I can tell this info isn't mentioned anywhere in the documentation/docstrings. I think this would be useful information to include [here](http://xarray.pydata.org/en/stable/generated/xarray.Dataset.mean.html?highlight=mean) for example: ```python In [47]: import xarray as xr In [48]: import numpy as np, pandas as pd In [50]: ds['foo'] = xr.DataArray(np.arange(6).reshape(2, 3), dims=['x', 'y']) In [53]: ds['bar'] = xr.DataArray(pd.date_range(start='2000', periods=6).values.reshape(2, 3), dims=['x', 'y']) In [54]: ds Out[54]: Dimensions: (x: 2, y: 3) Dimensions without coordinates: x, y Data variables: foo (x, y) int64 0 1 2 3 4 5 bar (x, y) datetime64[ns] 2000-01-01 2000-01-02 ... 2000-01-06 ``` ```python In [55]: ds.mean('x') Out[55]: Dimensions: (y: 3) Dimensions without coordinates: y Data variables: foo (y) float64 1.5 2.5 3.5 In [56]: ds.bar.mean('x') Out[56]: array(['2000-01-02T12:00:00.000000000', '2000-01-03T12:00:00.000000000', '2000-01-04T12:00:00.000000000'], dtype='datetime64[ns]') Dimensions without coordinates: y ``` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5898/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 1155507950,PR_kwDOAMm_X84zvNBA,6314,Add General issue template,13301940,closed,0,,,2,2022-03-01T15:54:16Z,2022-03-02T17:14:40Z,2022-03-02T13:56:25Z,MEMBER,,0,pydata/xarray/pulls/6314," - [x] Addresses https://github.com/pydata/xarray/issues/6027#issuecomment-1048737617 Cc @benbovy & @max-sixty ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6314/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1155512531,PR_kwDOAMm_X84zvN8f,6315,Disable CI runs on forks,13301940,closed,0,,,0,2022-03-01T15:58:29Z,2022-03-01T16:58:28Z,2022-03-01T16:57:43Z,MEMBER,,0,pydata/xarray/pulls/6315," This PR ensures all CI workflows are only enabled on the main repository. A few workflows were still being triggered on forks. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6315/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1120237582,PR_kwDOAMm_X84x4Smo,6224,Verify built dist/wheel,13301940,closed,0,,,0,2022-02-01T05:02:42Z,2022-02-03T15:44:41Z,2022-02-03T15:41:17Z,MEMBER,,0,pydata/xarray/pulls/6224," - [x] Closes #6222 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6224/reactions"", ""total_count"": 3, ""+1"": 3, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1090118252,PR_kwDOAMm_X84wWQZg,6119,Replace markdown issue templates with issue forms,13301940,closed,0,,,2,2021-12-28T20:41:40Z,2021-12-29T16:48:33Z,2021-12-29T16:47:48Z,MEMBER,,0,pydata/xarray/pulls/6119," - [ ] Closes #6027 **Preview**: ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6119/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1090121529,PR_kwDOAMm_X84wWREQ,6120,Remove pre-commit GHA workflow,13301940,closed,0,,,1,2021-12-28T20:50:09Z,2021-12-29T16:45:03Z,2021-12-29T16:28:45Z,MEMBER,,0,pydata/xarray/pulls/6120," We've been using [pre-commit](https://pre-commit.ci/) for the last month or so, and it seems to be working fine. This PR removes the redundant pre-commit hooks GHA workflow. - [ ] Towards https://github.com/pydata/xarray/issues/5940 ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6120/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 877830157,MDExOlB1bGxSZXF1ZXN0NjMxNzIyNjgy,5273,Release-workflow: Bug fix,13301940,closed,0,,,3,2021-05-06T18:21:24Z,2021-05-06T18:41:19Z,2021-05-06T18:41:17Z,MEMBER,,0,pydata/xarray/pulls/5273,This fixes https://github.com/pydata/xarray/issues/5232#issuecomment-833729171,"{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5273/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 877586869,MDExOlB1bGxSZXF1ZXN0NjMxNTEyOTA1,5267,Disable workflows on forks,13301940,closed,0,,,2,2021-05-06T14:55:05Z,2021-05-06T16:17:26Z,2021-05-06T16:17:25Z,MEMBER,,0,pydata/xarray/pulls/5267," Currently, the CI runs both on a user's fork and `pydata/xarray`. This leads to duplicate runs and the user is flooded with GitHub notifications in case of failures... This PR addresses this issue by making sure the workflows are triggered on `pydata/xarray` only. ![Screen Shot 2021-05-06 at 8 55 24 AM](https://user-images.githubusercontent.com/13301940/117319777-daffaf00-ae48-11eb-8523-5309542c524e.png) ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5267/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 877605250,MDExOlB1bGxSZXF1ZXN0NjMxNTI3OTEw,5268,Remove push event trigger for the release workflow,13301940,closed,0,,,1,2021-05-06T15:13:08Z,2021-05-06T15:14:20Z,2021-05-06T15:14:13Z,MEMBER,,0,pydata/xarray/pulls/5268," It turns out that pushes on main branch result in [an invalid package version](https://github.com/pydata/xarray/runs/2519311659). To address this issue, I am disabling the `push` event trigger on the release workflow Cc @keewis ```html Uploading xarray-0.17.1.dev108+gf5e4fd5f-py3-none-any.whl 0%| | 0.00/796k [00:00 400 '0.17.1.dev108+gf5e4fd5f' is an invalid value for Version. Error: Can't use PEP 440 local versions. See packaging.python.org/specifications/core-metadata for more information.

400 '0.17.1.dev108+gf5e4fd5f' is an invalid value for Version. Error: Can't use PEP 440 local versions. See packaging.python.org/specifications/core-metadata for more information.

The server could not comply with the request since it is either malformed or otherwise incorrect.

'0.17.1.dev108+gf5e4fd5f' is an invalid value for Version. Error: Can't use PEP 440 local versions. See packaging.python.org/specifications/core-metadata for more information. HTTPError: 400 Bad Request from test.pypi.org/legacy '0.17.1.dev108+gf5e4fd5f' is an invalid value for Version. Error: Can't use PEP 440 local versions. See packaging.python.org/specifications/core-metadata for more information. ```","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5268/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 873842812,MDExOlB1bGxSZXF1ZXN0NjI4NTQ0NTY3,5244,Add GitHub action for publishing artifacts to PyPI,13301940,closed,0,,,15,2021-05-02T05:18:42Z,2021-05-06T15:00:32Z,2021-05-06T14:46:10Z,MEMBER,,0,pydata/xarray/pulls/5244," This addresses https://github.com/pydata/xarray/issues/5232#issuecomment-830242266, and will (hopefully) reduce the time it takes to cut a new release. - [x] Passes `pre-commit run --all-files` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5244/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 873831430,MDExOlB1bGxSZXF1ZXN0NjI4NTM2NzE0,5243,Parametrize test for __setitem__ (for dask array),13301940,closed,0,,,4,2021-05-02T04:01:17Z,2021-05-06T12:49:49Z,2021-05-06T07:25:21Z,MEMBER,,0,pydata/xarray/pulls/5243," Follow up PR for #5174 - [x] Tests added - [x] Passes `pre-commit run --all-files` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5243/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 874231291,MDExOlB1bGxSZXF1ZXN0NjI4ODMyOTM3,5250,Fix bulleted list indentation in docstrings,13301940,closed,0,,,10,2021-05-03T05:10:53Z,2021-05-04T18:09:00Z,2021-05-03T23:23:49Z,MEMBER,,0,pydata/xarray/pulls/5250," - [x] Closes #5248 - [x] Passes `pre-commit run --all-files` As I understand it, the issue described in #5248 is caused by bad indentation... With this PR, we get the following: ![Screen Shot 2021-05-02 at 11 06 41 PM](https://user-images.githubusercontent.com/13301940/116842888-60f6ce00-ab9b-11eb-826e-7eeb26827d34.png) @max-sixty, let me know if there are other instances that need to be fixed as part of this PR.... ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5250/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 856035141,MDExOlB1bGxSZXF1ZXN0NjEzNjc5MDU5,5143,Add dependabot config (for updating github actions),13301940,closed,0,,,0,2021-04-12T14:27:04Z,2021-04-14T14:39:43Z,2021-04-14T14:39:42Z,MEMBER,,0,pydata/xarray/pulls/5143," - [x] Passes `pre-commit run --all-files` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5143/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 832768296,MDExOlB1bGxSZXF1ZXN0NTkzODc1MDU4,5039,Fix sticky sidebar responsiveness on small screens,13301940,closed,0,,,2,2021-03-16T12:53:32Z,2021-03-17T23:00:47Z,2021-03-17T23:00:46Z,MEMBER,,0,pydata/xarray/pulls/5039," - This PR reduces the max-width for `.container` divs so as to address issues with RTD's multiple version badges. - Latest: https://xarray.pydata.org/en/latest/index.html: the rtd badge box doesn't work - This PR: https://xray--5039.org.readthedocs.build/en/5039/index.html: appears to be working fine - Fixes CSS properties to enable appropriate toggle/responsiveness when using small screens. Unfortunately, this doesn't seem to have fixed the problem on small screens: ![Screen Shot 2021-03-16 at 10 43 05 AM](https://user-images.githubusercontent.com/13301940/111347113-814ae780-8644-11eb-815d-0056c6404313.png) - [x] Passes `pre-commit run --all-files`","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5039/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 790677360,MDExOlB1bGxSZXF1ZXN0NTU4ODUwMjUy,4835,πŸ“š New theme & rearrangement of the docs,13301940,closed,0,,,25,2021-01-21T04:17:33Z,2021-03-15T23:20:53Z,2021-03-15T23:20:51Z,MEMBER,,0,pydata/xarray/pulls/4835," - [ ] Closes #xxxx - [x] Passes `pre-commit run --all-files` - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4835/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 830167079,MDExOlB1bGxSZXF1ZXN0NTkxNzIxMTIx,5025,GHA for automatically canceling previous CI runs,13301940,closed,0,,,0,2021-03-12T14:24:27Z,2021-03-15T15:06:29Z,2021-03-15T15:06:27Z,MEMBER,,0,pydata/xarray/pulls/5025," The `styfle/cancel-workflow-action` requires a token with write permissions in order to cancel duplicate runs. It turns out that the default GitHub token access made available to pull requests from forks has read permissions only. To address this issue, this PR introduces a new workflow that uses a special `workflow_run` trigger which allows the workflow to run to run with a token with write permissions. - [x] Passes `pre-commit run --all-files` Cc @keewis","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5025/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 773945564,MDExOlB1bGxSZXF1ZXN0NTQ0OTQ5MTU3,4730,Migrate CI from azure pipelines to GitHub Actions,13301940,closed,0,,,22,2020-12-23T17:22:49Z,2021-02-25T22:03:22Z,2021-01-11T12:11:04Z,MEMBER,,0,pydata/xarray/pulls/4730," As discussed in today's dev meeting, it'd be convenient to migrate all our CIs from azure pipelines to GitHub Actions. - [x] Consolidate all style/type checks (isort, black, mypy, flake8) into a single workflow and use the `pre-commit` GitHub action. - [x] Create a main CI workflow and parametrize it for different settings - [x] Add minimum version policy workflow - [x] Add Doctests workflow - [x] Remove azure pipelines config - [x] Update docs: remove references to azure pipelines","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4730/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 773934304,MDExOlB1bGxSZXF1ZXN0NTQ0OTM5ODY5,4729,Trigger upstream CI on cron schedule (by default),13301940,closed,0,,,7,2020-12-23T17:00:24Z,2021-01-06T22:17:13Z,2021-01-06T22:17:11Z,MEMBER,,0,pydata/xarray/pulls/4729," As discussed in today's dev meeting, this PR modifies the `push` and `pull_request` event triggers by making sure the upstream dev CI is triggered by cron schedule by default. - [ ] Passes `isort . && black . && mypy . && flake8` - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4729/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 767049213,MDExOlB1bGxSZXF1ZXN0NTM5ODkzMTI5,4695,Remove dictionary unpacking when using `.loc` to avoid collision with `.sel` parameters,13301940,closed,0,,,2,2020-12-15T00:30:04Z,2020-12-16T14:50:34Z,2020-12-16T14:50:32Z,MEMBER,,0,pydata/xarray/pulls/4695," - [x] Closes #2840 - [x] Tests added - [x] Passes `isort . && black . && mypy . && flake8` - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4695/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 749116752,MDExOlB1bGxSZXF1ZXN0NTI1OTg3NDE1,4604,Amend upstream-dev GitHub action + Bug fixes,13301940,closed,0,,,5,2020-11-23T20:51:45Z,2020-12-05T00:52:48Z,2020-12-05T00:30:11Z,MEMBER,,0,pydata/xarray/pulls/4604," - [x] Closes #4603 - [x] Closes #4643 - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4604/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 731813879,MDU6SXNzdWU3MzE4MTM4Nzk=,4549,[Proposal] Migrate general discussions from the xarray gitter room to GitHub Discussions,13301940,closed,0,,,5,2020-10-28T21:48:29Z,2020-11-25T22:28:41Z,2020-11-25T22:28:41Z,MEMBER,,,,"Currently, xarray has a room on Gitter: https://gitter.im/pydata/xarray. This room works fine for discussions outside of the codebase. However, Gitter has a few disadvantages: - The contents are not indexed by search engines - Searching through existing discussions is almost impossible - Linking to prior conversations in the room is also complicated A few months ago, GitHub announced [**GitHub discussions**](https://github.blog/2020-05-06-new-from-satellite-2020-github-codespaces-github-discussions-securing-code-in-private-repositories-and-more/) which is meant to serve as a forum for discussions outside of the codebase. I am of the opinion that GitHub discussions is a better alternative to Gitter. I am wondering if xarray folks would be interested in enabling GitHub discussion on this repo, and migrating general discussions from Gitter to GitHub discussions? GitHub Discussions is still in beta, but projects can request early access [here](https://github.community/t/can-one-apply-for-github-discussions-beta/121120/27) Here is a list of a few projects with beta access: - https://github.com/vercel/vercel/discussions - https://github.com/KaTeX/KaTeX/discussions - https://github.com/vercel/next.js/discussions","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4549/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 741791697,MDExOlB1bGxSZXF1ZXN0NTIwMDQ0MDYx,4578,Direct users to GitHub discussions page for usage questions,13301940,closed,0,,,3,2020-11-12T17:34:05Z,2020-11-25T17:43:47Z,2020-11-25T16:09:08Z,MEMBER,,0,pydata/xarray/pulls/4578," Towards https://github.com/pydata/xarray/issues/4549 - [ ] Closes #xxxx - [ ] Tests added - [x] Passes `isort . && black . && mypy . && flake8` - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4578/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 742845971,MDExOlB1bGxSZXF1ZXN0NTIwODk3NDY1,4583,Add GH action for running tests against upstream dev,13301940,closed,0,,,7,2020-11-13T23:19:36Z,2020-11-22T04:37:52Z,2020-11-22T02:37:14Z,MEMBER,,0,pydata/xarray/pulls/4583," This GitHub action will run tests against the upstream dependencies. When the tests fail, the GH action will create an issue (with ""CI"" label). The body of the created issue includes: - test summary report - a link to the failed workflow run Here's a couple screenshots from a toy repository: - [x] Closes #4574 - [x] Tests added - [x] Passes `isort . && black . && mypy . && flake8` - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4583/reactions"", ""total_count"": 5, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 5, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 726020233,MDU6SXNzdWU3MjYwMjAyMzM=,4527,Refactor `xr.save_mfdataset()` to automatically save an xarray object backed by dask arrays to multiple files,13301940,open,0,,,2,2020-10-20T23:48:21Z,2020-10-22T17:06:46Z,,MEMBER,,,," **Is your feature request related to a problem? Please describe.** Currently, when a user wants to write multiple netCDF files in parallel with xarray and dask, they can take full advantage of `xr.save_mfdataset()` function. This function in its current state works fine, but the existing API requires that - the user generates file paths themselves - the user maps each chunk or dataset to a corresponding output file A few months ago, I wrote a [blog post](https://ncar.github.io/xdev/posts/writing-multiple-netcdf-files-in-parallel-with-xarray-and-dask/) showing how to save an xarray dataset backed by dask into multiple netCDF files, and since then I've been meaning to request a new feature to make this process convenient for users. **Describe the solution you'd like** **Would it be useful to actually refactor the existing `xr.save_mfdataset()` to automatically save an xarray object backed by dask arrays to multiple files without needing to create paths ourselves?** Today, this can be achieved via `xr.map_blocks`. In other words, is it possible to have something analogous to `to_zarr(....)` but for netCDF: ```python ds.save_mfdataset(prefix=""directory/my-dataset"") # or xr.save_mfdataset(ds, prefix=""directoy/my-dataset"") ``` ----> ```bash directory/my-dataset-chunk-1.nc directory/my-dataset-chunk-2.nc directory/my-dataset-chunk-3.nc .... ``` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4527/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 679445732,MDU6SXNzdWU2Nzk0NDU3MzI=,4341,Computing averaged time produces wrong/incorrect time values,13301940,closed,0,,,3,2020-08-14T23:15:01Z,2020-08-15T20:05:23Z,2020-08-15T20:05:23Z,MEMBER,,,," **What happened**: While computing averaged time using time_bounds via `times = bounds.mean('d2')`, I get weird results (see example below). It's my understanding that this is a bug, but I don't know yet where it's coming from. I should note that in addition to getting wrong time values, the resulting time values are not monotonically increasing even though my time bounds are. **What you expected to happen**: Correct averaged time values **Minimal Complete Verifiable Example**: ```python In [1]: import xarray as xr In [2]: import numpy as np In [3]: dates = xr.cftime_range(start='0400-01', end='2101-01', freq='120Y', calendar='noleap') In [4]: bounds = xr.DataArray(np.vstack([dates[:-1], dates[1:]]).T, dims=['time', 'd2']) In [5]: bounds Out[5]: array([[cftime.DatetimeNoLeap(400, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(520, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(520, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(640, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(640, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(760, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(760, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(880, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(880, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(1000, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(1000, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(1120, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(1120, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(1240, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(1240, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(1360, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(1360, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(1480, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(1480, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(1600, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(1600, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(1720, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(1720, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(1840, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(1840, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(1960, 12, 31, 0, 0, 0, 0)], [cftime.DatetimeNoLeap(1960, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(2080, 12, 31, 0, 0, 0, 0)]], dtype=object) Dimensions without coordinates: time, d2 In [6]: bounds.mean('d2') Out[6]: array([cftime.DatetimeNoLeap(460, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(580, 12, 31, 0, 0, 0, 0), cftime.DatetimeNoLeap(116, 1, 21, 0, 25, 26, 290448), cftime.DatetimeNoLeap(236, 1, 21, 0, 25, 26, 290448), cftime.DatetimeNoLeap(356, 1, 21, 0, 25, 26, 290448), cftime.DatetimeNoLeap(476, 1, 21, 0, 25, 26, 290448), cftime.DatetimeNoLeap(596, 1, 21, 0, 25, 26, 290448), cftime.DatetimeNoLeap(131, 2, 11, 0, 50, 52, 580897), cftime.DatetimeNoLeap(251, 2, 11, 0, 50, 52, 580897), cftime.DatetimeNoLeap(371, 2, 11, 0, 50, 52, 580897), cftime.DatetimeNoLeap(491, 2, 11, 0, 50, 52, 580897), cftime.DatetimeNoLeap(611, 2, 11, 0, 50, 52, 580897), cftime.DatetimeNoLeap(146, 3, 4, 1, 16, 18, 871345), cftime.DatetimeNoLeap(266, 3, 4, 1, 16, 18, 871345)], dtype=object) Dimensions without coordinates: time ``` **Anything else we need to know?**: **Environment**:
Output of xr.show_versions() ```python INSTALLED VERSIONS ------------------ commit: None python: 3.7.8 | packaged by conda-forge | (default, Jul 23 2020, 03:54:19) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 3.10.0-1127.13.1.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_US.UTF-8 LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.1.0 numpy: 1.19.1 scipy: 1.5.2 netCDF4: 1.5.4 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: 2.4.0 cftime: 1.2.1 nc_time_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.22.0 distributed: 2.22.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: None setuptools: 49.2.1.post20200802 pip: 20.2.1 conda: None pytest: None IPython: 7.17.0 sphinx: None ```
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4341/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 536694911,MDExOlB1bGxSZXF1ZXN0MzUyMTgyMTQ1,3612,Extend DatetimeAccessor properties and support `.dt` accessor for Timedelta,13301940,closed,0,,,2,2019-12-12T00:54:18Z,2019-12-18T18:03:13Z,2019-12-18T15:27:31Z,MEMBER,,0,pydata/xarray/pulls/3612," - [x] Closes #3609 - [x] Tests added - [x] Passes `black . && mypy . && flake8` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3612/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 520306672,MDExOlB1bGxSZXF1ZXN0MzM4OTE5MTg1,3502,Harmonize `FillValue` and `missing_value` during encoding and decoding steps,13301940,closed,0,,,7,2019-11-09T01:07:25Z,2019-12-11T20:09:15Z,2019-11-14T01:22:51Z,MEMBER,,0,pydata/xarray/pulls/3502," As pointed out in https://github.com/jbusecke/cmip6_preprocessing/issues/5, xarray appears to be very strict during the *encoding* and *decoding* steps even when there are (harmless) discrepancies between `missing_value` and `_FillValue`. For instance, when dtypes of `missing_value` and `_FillValue` are different, xarray gives up: ```python In [74]: from xarray.coding import variables In [75]: import numpy as np In [76]: import xarray as xr In [77]: original = xr.Variable( ...: (""x"",), ...: [0.0, -1.0, 1.0], ...: encoding={""_FillValue"": np.float32(1e20), ""missing_value"": np.float64(1e20)}, ...: ) In [78]: coder = variables.CFMaskCoder() In [79]: encoded = coder.encode(original) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in ----> 1 encoded = coder.encode(original) /glade/work/abanihi/devel/pangeo/xarray/xarray/coding/variables.py in encode(self, variable, name) 156 raise ValueError( 157 ""Variable {!r} has multiple fill values {}. "" --> 158 ""Cannot encode data. "".format(name, [fv, mv]) 159 ) 160 ValueError: Variable None has multiple fill values [1e+20, 1e+20]. Cannot encode data. ``` - [ ] Closes #xxxx - [x] Tests added - [x] Passes `black . && mypy . && flake8` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3502/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 496533454,MDExOlB1bGxSZXF1ZXN0MzE5ODY5NTAw,3328,Documentation improvements,13301940,closed,0,,,9,2019-09-20T20:28:15Z,2019-10-28T18:00:26Z,2019-09-29T13:50:22Z,MEMBER,,0,pydata/xarray/pulls/3328," Cc @dcherian ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3328/reactions"", ""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 1, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 510631260,MDExOlB1bGxSZXF1ZXN0MzMwOTcxNzk1,3430,Sync with latest version of cftime (v1.0.4),13301940,closed,0,,,5,2019-10-22T12:45:26Z,2019-10-22T19:25:18Z,2019-10-22T18:31:35Z,MEMBER,,0,pydata/xarray/pulls/3430," - Don't need `dayofwk=-1` for cftime>=1.0.4 ---- - [x] Closes #3426 and Fixes #3427 - [ ] Tests added - [x] Passes `black . && mypy . && flake8` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3430/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 510326302,MDU6SXNzdWU1MTAzMjYzMDI=,3426,`.sel()` failures when using latest cftime release (v1.0.4),13301940,closed,0,,,3,2019-10-21T22:19:24Z,2019-10-22T18:31:34Z,2019-10-22T18:31:34Z,MEMBER,,,,"I just updated to the latest `cftime`[ release](https://github.com/Unidata/cftime/releases/tag/v1.0.4rel), and all of a sudden `sel()` appears to be broken: ```python In [1]: import xarray as xr In [2]: import cftime In [3]: ds = xr.tutorial.load_dataset('rasm') In [4]: ds Out[4]: Dimensions: (time: 36, x: 275, y: 205) Coordinates: * time (time) object 1980-09-16 12:00:00 ... 1983-08-17 00:00:00 xc (y, x) float64 189.2 189.4 189.6 189.7 ... 17.65 17.4 17.15 16.91 yc (y, x) float64 16.53 16.78 17.02 17.27 ... 28.26 28.01 27.76 27.51 Dimensions without coordinates: x, y Data variables: Tair (time, y, x) float64 nan nan nan nan nan ... 29.8 28.66 28.19 28.21 Attributes: title: /workspace/jhamman/processed/R1002RBRxaaa01a/l... institution: U.W. source: RACM R1002RBRxaaa01a output_frequency: daily output_mode: averaged convention: CF-1.4 references: Based on the initial model of Liang et al., 19... comment: Output from the Variable Infiltration Capacity... nco_openmp_thread_number: 1 NCO: ""4.6.0"" history: Tue Dec 27 14:15:22 2016: ncatted -a dimension... In [5]: ds.sel(time=slice(""1980"", ""1982"")) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in ----> 1 ds.sel(time=slice(""1980"", ""1982"")) ~/opt/miniconda3/envs/intake-esm-dev/lib/python3.7/site-packages/xarray/core/dataset.py in sel(self, indexers, method, tolerance, drop, **indexers_kwargs) 1998 indexers = either_dict_or_kwargs(indexers, indexers_kwargs, ""sel"") 1999 pos_indexers, new_indexes = remap_label_indexers( -> 2000 self, indexers=indexers, method=method, tolerance=tolerance 2001 ) 2002 result = self.isel(indexers=pos_indexers, drop=drop) ~/opt/miniconda3/envs/intake-esm-dev/lib/python3.7/site-packages/xarray/core/coordinates.py in remap_label_indexers(obj, indexers, method, tolerance, **indexers_kwargs) 390 391 pos_indexers, new_indexes = indexing.remap_label_indexers( --> 392 obj, v_indexers, method=method, tolerance=tolerance 393 ) 394 # attach indexer's coordinate to pos_indexers ~/opt/miniconda3/envs/intake-esm-dev/lib/python3.7/site-packages/xarray/core/indexing.py in remap_label_indexers(data_obj, indexers, method, tolerance) 259 coords_dtype = data_obj.coords[dim].dtype 260 label = maybe_cast_to_coords_dtype(label, coords_dtype) --> 261 idxr, new_idx = convert_label_indexer(index, label, dim, method, tolerance) 262 pos_indexers[dim] = idxr 263 if new_idx is not None: ~/opt/miniconda3/envs/intake-esm-dev/lib/python3.7/site-packages/xarray/core/indexing.py in convert_label_indexer(index, label, index_name, method, tolerance) 123 _sanitize_slice_element(label.start), 124 _sanitize_slice_element(label.stop), --> 125 _sanitize_slice_element(label.step), 126 ) 127 if not isinstance(indexer, slice): ~/opt/miniconda3/envs/intake-esm-dev/lib/python3.7/site-packages/pandas/core/indexes/base.py in slice_indexer(self, start, end, step, kind) 5032 slice(1, 3) 5033 """""" -> 5034 start_slice, end_slice = self.slice_locs(start, end, step=step, kind=kind) 5035 5036 # return a slice ~/opt/miniconda3/envs/intake-esm-dev/lib/python3.7/site-packages/pandas/core/indexes/base.py in slice_locs(self, start, end, step, kind) 5246 start_slice = None 5247 if start is not None: -> 5248 start_slice = self.get_slice_bound(start, ""left"", kind) 5249 if start_slice is None: 5250 start_slice = 0 ~/opt/miniconda3/envs/intake-esm-dev/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_slice_bound(self, label, side, kind) 5158 # For datetime indices label may be a string that has to be converted 5159 # to datetime boundary according to its resolution. -> 5160 label = self._maybe_cast_slice_bound(label, side, kind) 5161 5162 # we need to look up the label ~/opt/miniconda3/envs/intake-esm-dev/lib/python3.7/site-packages/xarray/coding/cftimeindex.py in _maybe_cast_slice_bound(self, label, side, kind) 336 pandas.tseries.index.DatetimeIndex._maybe_cast_slice_bound"""""" 337 if isinstance(label, str): --> 338 parsed, resolution = _parse_iso8601_with_reso(self.date_type, label) 339 start, end = _parsed_string_to_bounds(self.date_type, resolution, parsed) 340 if self.is_monotonic_decreasing and len(self) > 1: ~/opt/miniconda3/envs/intake-esm-dev/lib/python3.7/site-packages/xarray/coding/cftimeindex.py in _parse_iso8601_with_reso(date_type, timestr) 114 # 1.0.3.4. 115 replace[""dayofwk""] = -1 --> 116 return default.replace(**replace), resolution 117 118 cftime/_cftime.pyx in cftime._cftime.datetime.replace() ValueError: Replacing the dayofyr or dayofwk of a datetime is not supported. ``` #### Output of ``xr.show_versions()``
# Paste the output here xr.show_versions() here ```python In [6]: xr.show_versions() INSTALLED VERSIONS ------------------ commit: None python: 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 14:38:56) [Clang 4.0.1 (tags/RELEASE_401/final)] python-bits: 64 OS: Darwin OS-release: 18.7.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.1 xarray: 0.14.0 pandas: 0.25.2 numpy: 1.17.2 scipy: None netCDF4: 1.5.1.2 pydap: None h5netcdf: None h5py: None Nio: None zarr: 2.3.2 cftime: 1.0.4 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.2.0 distributed: 2.5.1 matplotlib: None cartopy: None seaborn: None numbagg: None setuptools: 41.4.0 pip: 19.2.1 conda: None pytest: 5.0.1 IPython: 7.8.0 sphinx: 2.1.2 ```
#### Expected Output I can confirm that everything works just fine with an older version of `cftime`: ```python In [4]: ds.sel(time=slice(""1980"", ""1982"")) Out[4]: Dimensions: (time: 28, x: 275, y: 205) Coordinates: * time (time) object 1980-09-16 12:00:00 ... 1982-12-17 00:00:00 xc (y, x) float64 ... yc (y, x) float64 ... Dimensions without coordinates: x, y Data variables: Tair (time, y, x) float64 ... Attributes: title: /workspace/jhamman/processed/R1002RBRxaaa01a/l... institution: U.W. source: RACM R1002RBRxaaa01a output_frequency: daily output_mode: averaged convention: CF-1.4 references: Based on the initial model of Liang et al., 19... comment: Output from the Variable Infiltration Capacity... nco_openmp_thread_number: 1 NCO: ""4.6.0"" history: Tue Dec 27 14:15:22 2016: ncatted -a dimension... In [5]: import cftime In [6]: cftime.__version__ Out[6]: '1.0.3.4' In [7]: xr.__version__ Out[7]: '0.14.0' ``` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3426/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue