home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

308 rows where type = "pull" and user = 2448579 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: comments, draft, created_at (date), updated_at (date), closed_at (date)

state 2

  • closed 294
  • open 14

type 1

  • pull · 308 ✖

repo 1

  • xarray 308
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
2278499376 PR_kwDOAMm_X85uhFke 8997 Zarr: Optimize `region="auto"` detection dcherian 2448579 open 0     1 2024-05-03T22:13:18Z 2024-05-04T21:47:39Z   MEMBER   0 pydata/xarray/pulls/8997
  1. This moves the region detection code into ZarrStore so we only open the store once.
  2. Instead of opening the store as a dataset, construct a pd.Index directly to "auto"-infer the region.

The diff is large mostly because a bunch of code moved from backends/api.py to backends/zarr.py

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8997/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2278510478 PR_kwDOAMm_X85uhIGP 8998 Zarr: Optimize appending dcherian 2448579 open 0     0 2024-05-03T22:21:44Z 2024-05-03T22:23:34Z   MEMBER   1 pydata/xarray/pulls/8998

Builds on #8997

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8998/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2261855627 PR_kwDOAMm_X85togwQ 8969 CI: python 3.12 by default. dcherian 2448579 closed 0     2 2024-04-24T17:49:25Z 2024-04-29T16:21:20Z 2024-04-29T16:21:08Z MEMBER   0 pydata/xarray/pulls/8969
  1. Now that numba supports 3.12.
  2. Disabled pint on the main environment since it doesn't work. Pint is still installed in the all-but-dask env, which is still runs python 3.11 for this reason.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8969/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2261844699 PR_kwDOAMm_X85toeXT 8968 Bump dependencies incl `pandas>=2` dcherian 2448579 closed 0     0 2024-04-24T17:42:19Z 2024-04-27T14:17:16Z 2024-04-27T14:17:16Z MEMBER   0 pydata/xarray/pulls/8968
  • [ ] 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/8968/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2261917442 PR_kwDOAMm_X85touYl 8971 Delete pynio backend. dcherian 2448579 closed 0     2 2024-04-24T18:25:26Z 2024-04-25T14:38:23Z 2024-04-25T14:23:59Z MEMBER   0 pydata/xarray/pulls/8971
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8971/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2187743087 PR_kwDOAMm_X85ptH1f 8840 Grouper, Resampler as public api dcherian 2448579 open 0     0 2024-03-15T05:16:05Z 2024-04-21T16:21:34Z   MEMBER   1 pydata/xarray/pulls/8840

Expose Grouper and Resampler as public API

TODO: - [ ] Consider avoiding IndexVariable


  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8840/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2215762637 PR_kwDOAMm_X85rMHpN 8893 Avoid extra read from disk when creating Pandas Index. dcherian 2448579 open 0     1 2024-03-29T17:44:52Z 2024-04-08T18:55:09Z   MEMBER   0 pydata/xarray/pulls/8893
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8893/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2228266052 PR_kwDOAMm_X85r24hE 8913 Update hypothesis action to always save the cache dcherian 2448579 closed 0     0 2024-04-05T15:09:35Z 2024-04-05T16:51:05Z 2024-04-05T16:51:03Z MEMBER   0 pydata/xarray/pulls/8913

Update the cache always.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8913/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2224297504 PR_kwDOAMm_X85rpGUH 8906 Add invariant check for IndexVariable.name dcherian 2448579 open 0     1 2024-04-04T02:13:33Z 2024-04-05T07:12:54Z   MEMBER   1 pydata/xarray/pulls/8906

@benbovy this seems to be the root cause of #8646, the variable name in Dataset._variables does not match IndexVariable.name.

A good number of tests seem to fail though, so not sure if this is a good chck.

  • [ ] 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/8906/reactions",
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 2,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2136724736 PR_kwDOAMm_X85m_MtN 8754 Don't access data when creating DataArray from Variable. dcherian 2448579 closed 0     2 2024-02-15T14:48:32Z 2024-04-04T16:46:54Z 2024-04-04T16:46:53Z MEMBER   0 pydata/xarray/pulls/8754
  • [x] Closes #8753

This seems to have been around since 2016-ish, so presumably our backend code path is passing arrays around, not Variables.

cc @ilan-gold

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8754/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2224300175 PR_kwDOAMm_X85rpG4S 8907 Trigger hypothesis stateful tests nightly dcherian 2448579 closed 0     0 2024-04-04T02:16:59Z 2024-04-04T02:17:49Z 2024-04-04T02:17:47Z MEMBER   0 pydata/xarray/pulls/8907
  • [ ] 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/8907/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2098659175 PR_kwDOAMm_X85k-T6b 8658 Stateful tests with Dataset dcherian 2448579 closed 0     8 2024-01-24T16:34:59Z 2024-04-03T21:29:38Z 2024-04-03T21:29:36Z MEMBER   0 pydata/xarray/pulls/8658

I was curious to see if the hypothesis stateful testing would catch an inconsistent sequence of index manipulation operations like #8646. Turns out rename_vars is basically broken? (filed #8659) :P

PS: this blog post is amazing. E state = DatasetStateMachine() E state.assert_invariants() E > === E E <xarray.Dataset> E Dimensions: () E Data variables: E *empty* E === E E E > vars: ('1', '1_') E state.add_dim_coord(var=<xarray.Variable (1: 1)> E array([0], dtype=uint32)) E state.assert_invariants() E > === E E <xarray.Dataset> E Dimensions: (1: 1) E Coordinates: E * 1 (1) uint32 0 E Data variables: E 1_ (1) uint32 0 E === E E E > renaming 1 to 0 E state.rename_vars(newname='0') E state.assert_invariants() E > === E E <xarray.Dataset> E Dimensions: (1: 1) E Coordinates: E * 0 (1) uint32 0 E Dimensions without coordinates: 1 E Data variables: E 1_ (1) uint32 0 E === E E E state.teardown()

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8658/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2000205407 PR_kwDOAMm_X85fzupc 8467 [skip-ci] dev whats-new dcherian 2448579 closed 0     0 2023-11-18T03:59:29Z 2024-04-03T21:08:45Z 2023-11-18T15:20:37Z MEMBER   0 pydata/xarray/pulls/8467
  • [ ] 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/8467/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1989233637 PR_kwDOAMm_X85fOdAk 8446 Remove PseudoNetCDF dcherian 2448579 closed 0     0 2023-11-12T04:29:50Z 2024-04-03T21:08:44Z 2023-11-13T21:53:56Z MEMBER   0 pydata/xarray/pulls/8446

joining the party - [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8446/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 1,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2064698904 PR_kwDOAMm_X85jLHsQ 8584 Silence a bunch of CachingFileManager warnings dcherian 2448579 closed 0     1 2024-01-03T21:57:07Z 2024-04-03T21:08:27Z 2024-01-03T22:52:58Z MEMBER   0 pydata/xarray/pulls/8584  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8584/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2102850331 PR_kwDOAMm_X85lMW8k 8674 Fix negative slicing of Zarr arrays dcherian 2448579 closed 0     0 2024-01-26T20:22:21Z 2024-04-03T21:08:26Z 2024-02-10T02:57:32Z MEMBER   0 pydata/xarray/pulls/8674

Closes #8252 Closes #3921

  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8674/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2148245262 PR_kwDOAMm_X85nmmqX 8777 Return a dataclass from Grouper.factorize dcherian 2448579 closed 0     0 2024-02-22T05:41:29Z 2024-04-03T21:08:25Z 2024-03-15T04:47:30Z MEMBER   0 pydata/xarray/pulls/8777

Toward #8510, builds on #8776

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8777/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2148164557 PR_kwDOAMm_X85nmU5w 8775 [skip-ci] NamedArray: Add lazy indexing array refactoring plan dcherian 2448579 closed 0     0 2024-02-22T04:25:49Z 2024-04-03T21:08:21Z 2024-02-23T22:20:09Z MEMBER   0 pydata/xarray/pulls/8775

This adds a proposal for decoupling the lazy indexing array machinery, indexing adapter machinery, and Variable's setitem and getitem methods, so that the latter can be migrated to NamedArray.

cc @andersy005

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8775/reactions",
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 2,
    "eyes": 0
}
    xarray 13221727 pull
2198991054 PR_kwDOAMm_X85qTNFP 8861 upstream-dev CI: Fix interp and cumtrapz dcherian 2448579 closed 0     0 2024-03-21T02:49:40Z 2024-04-03T21:08:17Z 2024-03-21T04:16:45Z MEMBER   0 pydata/xarray/pulls/8861
  • [x] xref #8844
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8861/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1997636679 PR_kwDOAMm_X85frAC_ 8460 Add initialize_zarr dcherian 2448579 open 0     8 2023-11-16T19:45:05Z 2024-04-02T15:08:01Z   MEMBER   1 pydata/xarray/pulls/8460
  • [x] Closes #8343
  • [x] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst

The intended pattern is: ```python

after_init = initialize_zarr(store, ds, region_dims=("x",))
for i in range(ds.sizes["x"]):
    after_init.isel(x=[i]).to_zarr(store, region={"x": slice(i, i + 1)})

```

cc @slevang

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8460/reactions",
    "total_count": 5,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 3,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 2
}
    xarray 13221727 pull
2215539648 PR_kwDOAMm_X85rLW_p 8891 2024.03.0: Add whats-new dcherian 2448579 closed 0     0 2024-03-29T15:01:35Z 2024-03-29T17:07:19Z 2024-03-29T17:07:17Z MEMBER   0 pydata/xarray/pulls/8891  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8891/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2206047573 PR_kwDOAMm_X85qrHyn 8875 Optimize writes to existing Zarr stores. dcherian 2448579 closed 0     0 2024-03-25T15:32:47Z 2024-03-29T14:35:30Z 2024-03-29T14:35:29Z MEMBER   0 pydata/xarray/pulls/8875

We need to read existing variables to make sure we append or write to a region with the right encoding. Currently we decode all arrays in a Zarr group. Instead only decode those arrays for which we require encoding information.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8875/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2206385638 PR_kwDOAMm_X85qsSKm 8877 Don't allow overwriting indexes with region writes dcherian 2448579 closed 0     0 2024-03-25T18:13:19Z 2024-03-27T16:24:37Z 2024-03-27T16:24:35Z MEMBER   0 pydata/xarray/pulls/8877
  • [x] Closes #8589
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

cc @slevang

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8877/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2123950388 PR_kwDOAMm_X85mT6XD 8720 groupby: Dispatch quantile to flox. dcherian 2448579 closed 0     7 2024-02-07T21:42:42Z 2024-03-26T15:08:32Z 2024-03-26T15:08:30Z MEMBER   0 pydata/xarray/pulls/8720
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

@aulemahal would you be able to test against xclim's test suite. I imagine you're doing a bunch of grouped quantiles.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8720/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2184830377 PR_kwDOAMm_X85pjN8A 8829 Revert "Do not attempt to broadcast when global option ``arithmetic_b… dcherian 2448579 closed 0     7 2024-03-13T20:27:12Z 2024-03-20T15:30:12Z 2024-03-15T03:59:07Z MEMBER   0 pydata/xarray/pulls/8829

…roadcast=False`` (#8784)"

This reverts commit 11f89ecdd41226cf93da8d1e720d2710849cd23e.

Reverting #8784

Sadly that PR broke a lot of tests by breaking create_test_data with from xarray.tests import create_test_data create_test_data()

```

AssertionError Traceback (most recent call last) Cell In[3], line 2 1 from xarray.tests import create_test_data ----> 2 create_test_data()

File ~/repos/xarray/xarray/tests/init.py:329, in create_test_data(seed, add_attrs, dim_sizes) 327 obj.coords["numbers"] = ("dim3", numbers_values) 328 obj.encoding = {"foo": "bar"} --> 329 assert all(var.values.flags.writeable for var in obj.variables.values()) 330 return obj

AssertionError: ```

Somehow that code changes whether IndexVariable.values returns a writeable numpy array. I spent some time debugging but couldn't figure it out.

cc @etienneschalk

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8829/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2189750364 PR_kwDOAMm_X85p0Epw 8847 pandas 3 MultiIndex fixes dcherian 2448579 closed 0     0 2024-03-16T03:51:06Z 2024-03-20T15:00:20Z 2024-03-20T15:00:18Z MEMBER   0 pydata/xarray/pulls/8847

xref #8844 Closes https://github.com/xarray-contrib/flox/issues/342

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8847/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2189738090 PR_kwDOAMm_X85p0CKq 8846 Support pandas copy-on-write behaviour dcherian 2448579 closed 0     2 2024-03-16T03:14:46Z 2024-03-18T16:00:15Z 2024-03-18T16:00:12Z MEMBER   0 pydata/xarray/pulls/8846
  • [x] Closes #8843
  • [x] Tests added

```python import numpy as np import pandas as pd

pd.set_option("mode.copy_on_write", True)

from xarray.core.variable import _possibly_convert_objects

string_var = np.array(["a", "bc", "def"], dtype=object) datetime_var = np.array( ["2019-01-01", "2019-01-02", "2019-01-03"], dtype="datetime64[ns]" ) assert _possibly_convert_objects(string_var).flags.writeable assert _possibly_convert_objects(datetime_var).flags.writeable ```

The core issue is that we now get read-only arrays back from pandas here: https://github.com/pydata/xarray/blob/fbcac7611bf9a16750678f93483d3dbe0e261a0a/xarray/core/variable.py#L197-L212

@phofl is this expected?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8846/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2021856935 PR_kwDOAMm_X85g81gb 8509 Proof of concept - public Grouper objects dcherian 2448579 open 0     0 2023-12-02T04:52:27Z 2024-03-15T05:18:18Z   MEMBER   1 pydata/xarray/pulls/8509

Not for merging, just proof that it can be done nicely :)

Now builds on #8840 ~Builds on an older version of #8507~

Try it out!

```python import xarray as xr from xarray.core.groupers import SeasonGrouper, SeasonResampler

ds = xr.tutorial.open_dataset("air_temperature")

custom seasons!

ds.air.groupby(time=SeasonGrouper(["JF", "MAM", "JJAS", "OND"])).mean()

ds.air.resample(time=SeasonResampler(["DJF", "MAM", "JJAS", "ON"])).count() ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8509/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2187682227 PR_kwDOAMm_X85ps6tB 8839 [skip-ci] Fix upstream-dev env dcherian 2448579 closed 0     0 2024-03-15T04:08:58Z 2024-03-15T04:37:59Z 2024-03-15T04:37:58Z MEMBER   0 pydata/xarray/pulls/8839

upstream-dev env is broken

  • [x] Closes #8623
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8839/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2187646833 PR_kwDOAMm_X85psy9g 8837 Add dask-expr for windows envs dcherian 2448579 closed 0     0 2024-03-15T03:27:48Z 2024-03-15T04:06:05Z 2024-03-15T04:06:03Z MEMBER   0 pydata/xarray/pulls/8837
  • [x] Closes #8830
  • [ ] 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/8837/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2184606202 PR_kwDOAMm_X85picsD 8827 Add `dask-expr` to environment-3.12.yml dcherian 2448579 closed 0     0 2024-03-13T18:07:27Z 2024-03-13T20:20:46Z 2024-03-13T20:20:45Z MEMBER   0 pydata/xarray/pulls/8827

xref https://github.com/pydata/xarray/actions/runs/8269168819/job/22623800305?pr=8777

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8827/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2148242023 PR_kwDOAMm_X85nml9d 8776 Refactor Grouper objects dcherian 2448579 closed 0     0 2024-02-22T05:38:09Z 2024-03-07T21:50:07Z 2024-03-07T21:50:04Z MEMBER   0 pydata/xarray/pulls/8776

Some refactoring towards the Grouper refactor described in #8510

  1. Rename to Resampler from ResampleGrouper
  2. Refactor to a single "ResolvedGrouper" object that encapsulates the underling Grouper/Resampler object: UniqueGrouper, BinGrouper, or TimeResampler.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8776/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2021858121 PR_kwDOAMm_X85g81wJ 8510 Grouper object design doc dcherian 2448579 closed 0     6 2023-12-02T04:56:54Z 2024-03-06T02:27:07Z 2024-03-06T02:27:04Z MEMBER   0 pydata/xarray/pulls/8510

xref #8509, #6610

Rendered version here


@pydata/xarray I've been poking at this on and off for a year now and finally figured out how to do it cleanly (#8509).

I wrote up a design doc for Grouper objects that allow custom conversion of DataArrays to integer group codes, following the NEP template (which is absolutely great!). Such Grouper objects allow us to generalize the GroupBy interface to a much larger class of problems, and eventually provide a nice path to grouping by multiple variables (#6610)

8509 implements two custom Groupers for you to try out :)

```python import xarray as xr from xarray.core.groupers import SeasonGrouper, SeasonResampler

ds = xr.tutorial.open_dataset("air_temperature")

custom seasons!

ds.air.groupby(time=SeasonGrouper(["JF", "MAM", "JJAS", "OND"])).mean()

ds.air.resample(time=SeasonResampler(["DJF", "MAM", "JJAS", "ON"])).count() ```

All comments are welcome, 1. there are a couple of specific API and design decisions to be made. I'll make some comments pointing these out. 2. I'm also curious about what Grouper objects we should provide in Xarray.


cc @ilan-gold @ivirshup @aulemahal @tomvothecoder @jbusecke @katiedagon - it would be good to hear what "Groupers" would be useful for your work / projects. I bet you already have examples that fit this proposal

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8510/reactions",
    "total_count": 8,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 8,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2102852029 PR_kwDOAMm_X85lMXU0 8675 Fix NetCDF4 C version detection dcherian 2448579 closed 0     1 2024-01-26T20:23:54Z 2024-01-27T01:28:51Z 2024-01-27T01:28:49Z MEMBER   0 pydata/xarray/pulls/8675

This fixes the failure locally for me.

cc @max-sixty

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8675/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2098626592 PR_kwDOAMm_X85k-Mnt 8657 groupby: Don't set `method` by default on flox>=0.9 dcherian 2448579 closed 0     0 2024-01-24T16:20:57Z 2024-01-26T16:54:25Z 2024-01-26T16:54:23Z MEMBER   0 pydata/xarray/pulls/8657
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8657/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2021763059 PR_kwDOAMm_X85g8iNJ 8507 Deprecate `squeeze` in GroupBy. dcherian 2448579 closed 0     2 2023-12-02T00:21:43Z 2024-01-08T03:08:47Z 2024-01-08T01:05:23Z MEMBER   0 pydata/xarray/pulls/8507
  • [x] xref #2157, xref #1460
  • [x] Closes #8518, closes #8263
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8507/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2065788086 PR_kwDOAMm_X85jOw74 8585 Enable Zarr V3 tests in all CI runs. dcherian 2448579 closed 0     0 2024-01-04T14:45:44Z 2024-01-05T17:53:08Z 2024-01-05T17:53:06Z MEMBER   0 pydata/xarray/pulls/8585

🤦🏾‍♂️

Spotted in https://github.com/pydata/xarray/pull/8460

Builds on #8586

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8585/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2065809896 PR_kwDOAMm_X85jO1oX 8586 Bump min deps. dcherian 2448579 closed 0     0 2024-01-04T14:59:05Z 2024-01-05T16:13:16Z 2024-01-05T16:13:14Z MEMBER   0 pydata/xarray/pulls/8586
  • [x] Closes #8581
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8586/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2066129022 PR_kwDOAMm_X85jP678 8587 Silence another warning in test_backends.py dcherian 2448579 closed 0     1 2024-01-04T18:20:49Z 2024-01-05T16:13:05Z 2024-01-05T16:13:03Z MEMBER   0 pydata/xarray/pulls/8587

Using 255 as fillvalue for int8 arrays will not be allowed any more. Previously this overflowed to -1. Now specify that instead.

On numpy 1.24.4 ```

np.array([255], dtype="i1") DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future.

array([-1], dtype=int8) ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8587/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2052694433 PR_kwDOAMm_X85ilhQm 8565 Faster encoding functions. dcherian 2448579 closed 0     1 2023-12-21T16:05:02Z 2024-01-04T14:25:45Z 2024-01-04T14:25:43Z MEMBER   0 pydata/xarray/pulls/8565

Spotted when profiling some write workloads. 1. Speeds up the check for multi-index 2. Speeds up one string encoder by not re-creating variables when not necessary.

@benbovy is there a better way?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8565/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1976752481 PR_kwDOAMm_X85ekPdj 8412 Minimize duplication in `map_blocks` task graph dcherian 2448579 closed 0     7 2023-11-03T18:30:02Z 2024-01-03T04:10:17Z 2024-01-03T04:10:15Z MEMBER   0 pydata/xarray/pulls/8412

Builds on #8560

  • [x] Closes #8409
  • [x] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst

cc @max-sixty

``` print(len(cloudpickle.dumps(da.chunk(lat=1, lon=1).map_blocks(lambda x: x))))

779354739 -> 47699827

print(len(cloudpickle.dumps(da.chunk(lat=1, lon=1).drop_vars(da.indexes).map_blocks(lambda x: x))))

15981508

```

This is a quick attempt. I think we can generalize this to minimize duplication.

The downside is that the graphs are not totally embarrassingly parallel any more. This PR:

vs main:

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8412/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2052610515 PR_kwDOAMm_X85ilOq9 8564 Fix mypy type ignore dcherian 2448579 closed 0     1 2023-12-21T15:15:26Z 2023-12-21T15:41:13Z 2023-12-21T15:24:52Z MEMBER   0 pydata/xarray/pulls/8564  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8564/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2047617215 PR_kwDOAMm_X85iUJ7y 8560 Adapt map_blocks to use new Coordinates API dcherian 2448579 closed 0     0 2023-12-18T23:11:55Z 2023-12-20T17:11:18Z 2023-12-20T17:11:16Z MEMBER   0 pydata/xarray/pulls/8560

Fixes roundtripping of string dtype indexes

  • [x] Tests added
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8560/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2033054792 PR_kwDOAMm_X85hi5U2 8532 Whats-new for 2023.12.0 dcherian 2448579 closed 0     0 2023-12-08T17:29:47Z 2023-12-08T19:36:28Z 2023-12-08T19:36:26Z MEMBER   0 pydata/xarray/pulls/8532
  • [ ] 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/8532/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2021754904 PR_kwDOAMm_X85g8gnU 8506 Deprecate `squeeze` in GroupBy. dcherian 2448579 closed 0     1 2023-12-02T00:08:50Z 2023-12-02T00:13:36Z 2023-12-02T00:13:36Z MEMBER   0 pydata/xarray/pulls/8506
  • [x] Closes #2157
  • [ ] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

Could use a close-ish review.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8506/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2003229011 PR_kwDOAMm_X85f9xPG 8472 Avoid duplicate Zarr array read dcherian 2448579 closed 0     0 2023-11-21T00:16:34Z 2023-12-01T02:58:22Z 2023-12-01T02:47:03Z MEMBER   0 pydata/xarray/pulls/8472

We already get the underlying Zarr array in https://github.com/pydata/xarray/blob/bb8511e0894020e180d95d2edb29ed4036ac6447/xarray/backends/zarr.py#L529-L531

and then pass it to open_store_variable. Just pass that array down to ZarrArrayWrapper instead of reading it from the datastore again.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8472/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2015530249 PR_kwDOAMm_X85gnO8L 8489 Minor to_zarr optimizations dcherian 2448579 closed 0     0 2023-11-28T23:56:32Z 2023-12-01T02:20:19Z 2023-12-01T02:18:18Z MEMBER   0 pydata/xarray/pulls/8489

Avoid repeatedly pinging a remote store by requesting keys at one go.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8489/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1997656427 PR_kwDOAMm_X85frEdb 8461 2023.11.0 Whats-new dcherian 2448579 closed 0     0 2023-11-16T19:55:12Z 2023-11-17T21:02:22Z 2023-11-17T21:02:20Z MEMBER   0 pydata/xarray/pulls/8461  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8461/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1997136566 PR_kwDOAMm_X85fpRL3 8458 Pin mypy < 1.7 dcherian 2448579 closed 0     0 2023-11-16T15:31:26Z 2023-11-16T17:29:04Z 2023-11-16T17:29:03Z MEMBER   0 pydata/xarray/pulls/8458

xref #8448 get back to green checks for now.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8458/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1995186323 PR_kwDOAMm_X85finmE 8452 [skip-ci] Small updates to IO docs. dcherian 2448579 closed 0     0 2023-11-15T17:05:47Z 2023-11-16T15:19:59Z 2023-11-16T15:19:57Z MEMBER   0 pydata/xarray/pulls/8452

Also fixes the RTD failure on main

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8452/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1989227042 PR_kwDOAMm_X85fObtL 8445 Pin pint to >=0.22 dcherian 2448579 closed 0     3 2023-11-12T03:58:40Z 2023-11-13T19:39:54Z 2023-11-13T19:39:53Z MEMBER   0 pydata/xarray/pulls/8445
  • [x] Closes https://github.com/pydata/xarray/issues/7971
  • [x] Closes https://github.com/pydata/xarray/issues/8437.

We were previously pinned to <0.21 Removing the pin didn't change the env but with >=0.21 we get 0.22 which works.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8445/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1989212292 PR_kwDOAMm_X85fOYwT 8444 Remove keep_attrs from resample signature dcherian 2448579 closed 0     1 2023-11-12T02:57:59Z 2023-11-12T22:53:36Z 2023-11-12T22:53:35Z MEMBER   0 pydata/xarray/pulls/8444
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8444/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1635949876 PR_kwDOAMm_X85MpxlL 7659 Redo whats-new for 2023.03.0 dcherian 2448579 closed 0     0 2023-03-22T15:02:38Z 2023-11-06T04:25:54Z 2023-03-22T15:42:49Z MEMBER   0 pydata/xarray/pulls/7659  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7659/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1630533356 PR_kwDOAMm_X85MXo4e 7643 Whats-new for release 2023.03.0 dcherian 2448579 closed 0     0 2023-03-18T19:14:55Z 2023-11-06T04:25:53Z 2023-03-20T15:57:36Z MEMBER   0 pydata/xarray/pulls/7643  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7643/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 1,
    "eyes": 0
}
    xarray 13221727 pull
1471673992 PR_kwDOAMm_X85EFDiU 7343 Fix mypy failures dcherian 2448579 closed 0     1 2022-12-01T17:16:44Z 2023-11-06T04:25:52Z 2022-12-01T18:25:07Z MEMBER   0 pydata/xarray/pulls/7343  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7343/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1533942791 PR_kwDOAMm_X85HahUq 7440 v2023.01.0 whats-new dcherian 2448579 closed 0     0 2023-01-15T18:20:28Z 2023-11-06T04:25:52Z 2023-01-18T21:18:49Z MEMBER   0 pydata/xarray/pulls/7440

Should update the date and delete empty sections before merging

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7440/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1942666419 PR_kwDOAMm_X85cxojc 8304 Move Variable aggregations to NamedArray dcherian 2448579 closed 0     6 2023-10-13T21:31:01Z 2023-11-06T04:25:43Z 2023-10-17T19:14:12Z MEMBER   0 pydata/xarray/pulls/8304
  • [x] fix breaking attrs test
  • [x] Look at numeric_only in NAMED_ARRAY_OBJECT
  • xref #8238
  • [ ] Tests added
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8304/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1689364566 PR_kwDOAMm_X85PbeOv 7796 Speed up .dt accessor by preserving Index objects. dcherian 2448579 closed 0     1 2023-04-29T04:22:10Z 2023-11-06T04:25:42Z 2023-05-16T17:55:48Z MEMBER   0 pydata/xarray/pulls/7796
  • [ ] 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/7796/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1973472421 PR_kwDOAMm_X85eZF4x 8400 Better attr diff for `testing.assert_identical` dcherian 2448579 closed 0     2 2023-11-02T04:15:09Z 2023-11-04T20:25:37Z 2023-11-04T20:25:36Z MEMBER   0 pydata/xarray/pulls/8400
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst

This gives us better reprs where only differing attributes are shown in the diff.

On main: ... Differing coordinates: L * x (x) <U1 'a' 'b' foo: bar same: same R * x (x) <U1 'a' 'c' source: 0 foo: baz same: same ...

With this PR: ``` Differing coordinates: L * x (x) %cU1 'a' 'b' Differing variable attributes: foo: bar R * x (x) %cU1 'a' 'c' Differing variable attributes: source: 0 foo: baz

```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8400/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1975400777 PR_kwDOAMm_X85efqSl 8408 Generalize explicit_indexing_adapter dcherian 2448579 open 0     0 2023-11-03T03:29:40Z 2023-11-03T03:53:25Z   MEMBER   1 pydata/xarray/pulls/8408

Use as_indexable instead of NumpyIndexingAdapter

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8408/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1962040911 PR_kwDOAMm_X85dyZBT 8373 Use `opt_einsum` by default if installed. dcherian 2448579 closed 0     2 2023-10-25T18:59:38Z 2023-10-28T03:31:07Z 2023-10-28T03:31:05Z MEMBER   0 pydata/xarray/pulls/8373
  • [x] Closes #7764
  • [x] Closes #8017
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8373/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1954535213 PR_kwDOAMm_X85dZT47 8351 [skip-ci] Add benchmarks for Dataset binary ops, chunk dcherian 2448579 closed 0     1 2023-10-20T15:31:36Z 2023-10-20T18:08:40Z 2023-10-20T18:08:38Z MEMBER   0 pydata/xarray/pulls/8351

xref #8339 xref #8350

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8351/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1954360112 PR_kwDOAMm_X85dYtpz 8349 [skip-ci] dev whats-new dcherian 2448579 closed 0     1 2023-10-20T14:02:07Z 2023-10-20T17:28:19Z 2023-10-20T14:54:30Z MEMBER   0 pydata/xarray/pulls/8349
  • [ ] 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/8349/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1950480317 PR_kwDOAMm_X85dLkAj 8334 Whats-new: 2023.10.0 dcherian 2448579 closed 0     1 2023-10-18T19:22:06Z 2023-10-19T16:00:00Z 2023-10-19T15:59:58Z MEMBER   0 pydata/xarray/pulls/8334  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8334/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1944347086 PR_kwDOAMm_X85c2nyz 8316 Enable numbagg for reductions dcherian 2448579 closed 0     3 2023-10-16T04:46:10Z 2023-10-18T14:54:48Z 2023-10-18T10:39:30Z MEMBER   0 pydata/xarray/pulls/8316
  • [ ] Tests added - check bottleneck tests
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8316/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1861954973 PR_kwDOAMm_X85YhnBZ 8100 Remove np.asarray in formatting.py dcherian 2448579 closed 0     2 2023-08-22T18:08:33Z 2023-10-18T13:31:25Z 2023-10-18T10:40:38Z MEMBER   0 pydata/xarray/pulls/8100  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8100/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1942673099 PR_kwDOAMm_X85cxp-D 8305 Update labeler.yml to add NamedArray dcherian 2448579 closed 0     0 2023-10-13T21:39:56Z 2023-10-14T06:47:08Z 2023-10-14T06:47:07Z MEMBER   0 pydata/xarray/pulls/8305
  • [ ] 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/8305/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1874773066 PR_kwDOAMm_X85ZMtUP 8126 Allow creating DataArrays with nD coordinate variables dcherian 2448579 closed 0     0 2023-08-31T04:40:37Z 2023-09-22T12:48:38Z 2023-09-22T12:48:34Z MEMBER   0 pydata/xarray/pulls/8126
  • [x] Closes #8106
  • [x] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst

cc @blaylockbk

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8126/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1902086612 PR_kwDOAMm_X85aoYuf 8206 flox: Set fill_value=np.nan always. dcherian 2448579 open 0     0 2023-09-19T02:19:49Z 2023-09-19T02:23:26Z   MEMBER   1 pydata/xarray/pulls/8206
  • [x] Closes #8090
  • [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/8206/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1861692451 PR_kwDOAMm_X85YgtYD 8098 [skip-ci] dev whats-new dcherian 2448579 closed 0     0 2023-08-22T15:20:54Z 2023-08-22T20:46:29Z 2023-08-22T20:46:29Z MEMBER   0 pydata/xarray/pulls/8098  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8098/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1855338426 PR_kwDOAMm_X85YLRQH 8081 Add 2023.08.0 whats-new dcherian 2448579 closed 0     0 2023-08-17T16:36:06Z 2023-08-18T20:12:27Z 2023-08-18T20:12:25Z MEMBER   0 pydata/xarray/pulls/8081  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8081/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1829952467 PR_kwDOAMm_X85W1yq4 8033 Reduce pre-commit update frequency to monthly from weekly. dcherian 2448579 closed 0     0 2023-07-31T20:16:05Z 2023-08-01T16:48:12Z 2023-08-01T16:48:10Z MEMBER   0 pydata/xarray/pulls/8033

We could even go down to quarterly

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8033/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1642301775 PR_kwDOAMm_X85M-3H- 7684 Automatically chunk `other` in GroupBy binary ops. dcherian 2448579 closed 0     2 2023-03-27T15:15:22Z 2023-07-28T03:12:20Z 2023-07-27T16:41:33Z MEMBER   0 pydata/xarray/pulls/7684
  • [x] Closes #7683
  • [x] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7684/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
923355397 MDExOlB1bGxSZXF1ZXN0NjcyMTI5NzY4 5480 Implement weighted groupby dcherian 2448579 open 0     1 2021-06-17T02:57:17Z 2023-07-27T18:09:55Z   MEMBER   1 pydata/xarray/pulls/5480
  • xref #3937
  • [ ] Tests added
  • [ ] Passes pre-commit run --all-files
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst

Initial proof-of-concept. Suggestions to improve this are very welcome.

Here's some convenient testing code ``` python
import xarray as xr

ds = xr.tutorial.open_dataset('rasm').load() month_length = ds.time.dt.days_in_month weights = month_length.groupby('time.season') / month_length.groupby('time.season').sum()

actual = ds.weighted(month_length).groupby("time.season").mean() expected = (ds * weights).groupby('time.season').sum(skipna=False) xr.testing.assert_allclose(actual, expected) ```

I've added info to the repr python ds.weighted(month_length).groupby("time.season") WeightedDatasetGroupBy, grouped over 'season' 4 groups with labels 'DJF', 'JJA', 'MAM', 'SON'. weighted along dimensions: time by 'days_in_month'

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5480/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1675073096 PR_kwDOAMm_X85OrnNQ 7769 Fix groupby_bins when labels are specified dcherian 2448579 closed 0     2 2023-04-19T14:49:23Z 2023-07-22T01:01:34Z 2023-04-20T17:17:16Z MEMBER   0 pydata/xarray/pulls/7769
  • [x] Closes #7766
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

@gsieros can you try this out please?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7769/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1812646094 PR_kwDOAMm_X85V7g7q 8007 Update copyright year in README dcherian 2448579 closed 0     0 2023-07-19T20:00:50Z 2023-07-20T21:13:27Z 2023-07-20T21:13:26Z MEMBER   0 pydata/xarray/pulls/8007  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8007/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1806239984 PR_kwDOAMm_X85Vl5Ch 7989 Allow opening datasets with nD dimenson coordinate variables. dcherian 2448579 closed 0     5 2023-07-15T17:33:18Z 2023-07-19T19:06:25Z 2023-07-19T18:25:33Z MEMBER   0 pydata/xarray/pulls/7989
  • [x] Closes #2233
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

Avoid automatic creating of Index variable when nD variable shares name with one of its dimensions.

Closes #2233

```python url = "http://www.smast.umassd.edu:8080/thredds/dodsC/FVCOM/NECOFS/Forecasts/NECOFS_GOM3_FORECAST.nc" ds = xr.open_dataset(url, engine="netcdf4") display(ds)

xr.testing._assert_internal_invariants(ds, check_default_indexes=False) ! no raise on #7368 ```

~The internal invariants assert fails on main but succeeds on #7368~. EDIT: now fixed the invariants check.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7989/reactions",
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 1,
    "eyes": 0
}
    xarray 13221727 pull
1736542260 PR_kwDOAMm_X85R6fac 7888 Add cfgrib,ipywidgets to doc env dcherian 2448579 closed 0     3 2023-06-01T15:11:10Z 2023-06-16T14:14:01Z 2023-06-16T14:13:59Z MEMBER   0 pydata/xarray/pulls/7888
  • [x] Closes #7841
  • [x] Closes #7892
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7888/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1600382587 PR_kwDOAMm_X85Kyh9V 7561 Introduce Grouper objects internally dcherian 2448579 closed 0     4 2023-02-27T03:11:36Z 2023-06-14T21:18:26Z 2023-05-04T02:35:57Z MEMBER   0 pydata/xarray/pulls/7561

Builds on the refactoring in #7206

  • [x] xref #6610
  • [x] Use TimeResampleGrouper
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7561/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1701070898 PR_kwDOAMm_X85QCzA1 7830 Fix .groupby(multi index level) dcherian 2448579 closed 0     0 2023-05-08T23:16:07Z 2023-06-06T00:21:36Z 2023-06-06T00:21:31Z MEMBER   0 pydata/xarray/pulls/7830
  • [x] Closes #6836
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7830/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1639732867 PR_kwDOAMm_X85M2fjy 7670 Delete built-in cfgrib backend dcherian 2448579 closed 0     5 2023-03-24T16:53:56Z 2023-06-01T15:22:33Z 2023-03-29T15:19:51Z MEMBER   0 pydata/xarray/pulls/7670
  • [x] Closes #7199
  • [x] Tests ~added~ deleted
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7670/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1688781350 PR_kwDOAMm_X85PZf3R 7795 [skip-ci] Add cftime groupby, resample benchmarks dcherian 2448579 closed 0     8 2023-04-28T15:49:39Z 2023-05-24T16:07:58Z 2023-05-02T15:56:55Z MEMBER   0 pydata/xarray/pulls/7795

xref #7730

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7795/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1700678362 PR_kwDOAMm_X85QBdXY 7828 GroupBy: Fix reducing by subset of grouper dims dcherian 2448579 open 0     0 2023-05-08T18:00:54Z 2023-05-10T02:41:39Z   MEMBER   1 pydata/xarray/pulls/7828
  • [x] Tests added

Fixes yet another bug with GroupBy reductions. We weren't assigning the group index when reducing by a subset of dimensions present on the grouper

This will only pass when flox 0.7.1 reaches conda-forge.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7828/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1692612622 PR_kwDOAMm_X85PmMOy 7809 Fix `min_count` behaviour with flox. dcherian 2448579 closed 0     0 2023-05-02T15:13:17Z 2023-05-10T02:39:45Z 2023-05-10T02:39:43Z MEMBER   0 pydata/xarray/pulls/7809
  • [x] Closes #7808
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7809/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1689773381 PR_kwDOAMm_X85PctlP 7798 Fix groupby binary ops when grouped array is subset relative to other dcherian 2448579 closed 0     3 2023-04-30T04:14:14Z 2023-05-03T12:58:35Z 2023-05-02T14:48:42Z MEMBER   0 pydata/xarray/pulls/7798
  • [x] Closes #7797
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

cc @slevang

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7798/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1632422255 PR_kwDOAMm_X85Md6iW 7650 Pin pandas < 2 dcherian 2448579 closed 0     3 2023-03-20T16:03:58Z 2023-04-25T13:42:48Z 2023-03-22T14:53:53Z MEMBER   0 pydata/xarray/pulls/7650

Pandas is expecting to release v2 in two weeks (pandas-dev/pandas#46776 (comment)). But we are still incompatible with their main branch: - #7441 - #7420

This PR pins pandas to <2

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7650/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1677167290 PR_kwDOAMm_X85Oyokd 7775 [skip-ci] dev whats-new dcherian 2448579 closed 0     0 2023-04-20T17:54:27Z 2023-04-20T21:08:14Z 2023-04-20T21:08:11Z MEMBER   0 pydata/xarray/pulls/7775  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7775/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1677161134 PR_kwDOAMm_X85OynVg 7774 [skip-ci] Release 2023.04.2 dcherian 2448579 closed 0     0 2023-04-20T17:49:46Z 2023-04-20T18:26:39Z 2023-04-20T18:26:37Z MEMBER   0 pydata/xarray/pulls/7774  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7774/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1666853925 PR_kwDOAMm_X85OQT4o 7753 Add benchmark against latest release on main. dcherian 2448579 closed 0     1 2023-04-13T17:35:33Z 2023-04-18T22:08:58Z 2023-04-18T22:08:56Z MEMBER   0 pydata/xarray/pulls/7753

This adds a benchmark of HEAD vs the latest tag on main.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7753/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1671616256 PR_kwDOAMm_X85OgCYb 7762 Fix binning by unsorted array dcherian 2448579 closed 0     0 2023-04-17T17:04:45Z 2023-04-18T14:48:28Z 2023-04-18T14:48:23Z MEMBER   0 pydata/xarray/pulls/7762
  • [x] Closes #7759
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7762/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1668569869 PR_kwDOAMm_X85OV_JV 7757 Add whats-new for v2023.04.0 dcherian 2448579 closed 0     0 2023-04-14T16:36:01Z 2023-04-14T17:25:37Z 2023-04-14T17:25:35Z MEMBER   0 pydata/xarray/pulls/7757  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7757/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
809366777 MDExOlB1bGxSZXF1ZXN0NTc0MjQxMTE3 4915 Better rolling reductions dcherian 2448579 closed 0     6 2021-02-16T14:37:49Z 2023-04-13T15:46:18Z 2021-02-19T19:44:04Z MEMBER   0 pydata/xarray/pulls/4915

Implements most of https://github.com/pydata/xarray/issues/4325#issuecomment-716399575 ``` python %load_ext memory_profiler

import numpy as np import xarray as xr

temp = xr.DataArray(np.zeros((5000, 500)), dims=("x", "y"))

roll = temp.rolling(x=10, y=20)

%memit roll.sum() %memit roll.reduce(np.sum) %memit roll.reduce(np.nansum) # master branch behaviour peak memory: 245.18 MiB, increment: 81.92 MiB peak memory: 226.09 MiB, increment: 62.69 MiB peak memory: 4493.82 MiB, increment: 4330.43 MiB `` - [x] xref #4325 - [x] asv benchmarks added - [x] Passespre-commit run --all-files- [x] User visible changes (including notable bug fixes) are documented inwhats-new.rst`

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4915/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1658287743 PR_kwDOAMm_X85N0Afw 7736 align: Avoid reindexing when join="exact" dcherian 2448579 closed 0     0 2023-04-07T02:46:08Z 2023-04-12T14:41:53Z 2023-04-12T14:41:51Z MEMBER   0 pydata/xarray/pulls/7736

xref #7730, #7737

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7736/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1658287592 PR_kwDOAMm_X85N0Ad4 7735 Avoid recasting a CFTimeIndex dcherian 2448579 closed 0     1 2023-04-07T02:45:55Z 2023-04-11T21:12:07Z 2023-04-11T21:12:05Z MEMBER   0 pydata/xarray/pulls/7735

xref #7730

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7735/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1658319105 PR_kwDOAMm_X85N0Gez 7738 [skip-ci] Add alignment benchmarks dcherian 2448579 closed 0     0 2023-04-07T03:40:32Z 2023-04-07T22:31:08Z 2023-04-07T22:31:05Z MEMBER   0 pydata/xarray/pulls/7738

xref #4648

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7738/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1656619829 PR_kwDOAMm_X85Nuo9M 7729 Test: new index from dask.array computes only once dcherian 2448579 closed 0     0 2023-04-06T03:52:22Z 2023-04-06T04:15:47Z 2023-04-06T04:15:45Z MEMBER   0 pydata/xarray/pulls/7729

Closes #1533

Seems to have been fixed by the indexes refactor

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7729/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1327380960 PR_kwDOAMm_X848lec7 6874 Avoid calling np.asarray on lazy indexing classes dcherian 2448579 closed 0     6 2022-08-03T15:13:00Z 2023-03-31T15:15:31Z 2023-03-31T15:15:29Z MEMBER   0 pydata/xarray/pulls/6874

This is motivated by https://docs.rapids.ai/api/kvikio/stable/api.html#kvikio.zarr.GDSStore which on read loads the data directly into GPU memory.

Currently we rely on np.asarray to convert a BackendArray wrapped with a number of lazy indexing classes to a real array but this breaks for GDSStore because the underlying array is a cupy array, so using np.asarray raises an error.

np.asarray will raise if a non-numpy array is returned so we need to use something else.

Here I added get_array which like np.array recurses down until it receives a duck array.

Quite a few things are broken I think , but I'd like feedback on the approach.

I considered np.asanyarray(..., like=...) but that would require the lazy indexing classes to know what they're wrapping which doesn't seem right.

Ref: https://github.com/xarray-contrib/cupy-xarray/pull/10 which adds a kvikio backend entrypoint

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6874/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1421065459 PR_kwDOAMm_X85BbUp9 7206 Save groupby codes after factorizing, pass to flox dcherian 2448579 closed 0     2 2022-10-24T16:00:35Z 2023-03-30T04:36:40Z 2023-03-29T16:28:28Z MEMBER   0 pydata/xarray/pulls/7206
  • [x] Closes #6689,
  • xref #6610
  • [x] Closes #7601
  • [x] Tests added

This is an alternative to #6689. - There I tried to avoid factorizing in the GroupBy constructor, and passed the by variable directly to flox. Most GroupBy methods however depend on various steps in __init__, so it became messy. - Here I instead preserve factorizing in the constructor and pass the factorized codes to flox. This simplifies things a lot. Since we'll want to preserve the "for loop over groups" approach for GroupBy.map, we'll need something like this anyway.

The large amount of deleted code in _flox_reduce here suggests to me that this is the better approach.

I think we could also use this to generalize to multiple groupers: - factorize each, - ravel_muti_index to generate a singe variable to groupby - apply - reshape to output shape - assign new indices.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7206/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1268667121 PR_kwDOAMm_X845hbaE 6689 Refactor GroupBy init to avoid factorization dcherian 2448579 closed 0     0 2022-06-12T18:41:04Z 2023-03-29T16:28:29Z 2023-03-29T16:28:29Z MEMBER   1 pydata/xarray/pulls/6689

Refactoring GroupBy.__init__ as a step toward #6610

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6689/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1643132089 PR_kwDOAMm_X85NBqEW 7690 [skip-ci] Add compute to groupby benchmarks dcherian 2448579 closed 0     2 2023-03-28T03:19:34Z 2023-03-29T15:21:06Z 2023-03-29T15:21:03Z MEMBER   0 pydata/xarray/pulls/7690

oops!

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7690/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull

Next page

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 2162.133ms · About: xarray-datasette