Skip to content

Commit d02d2fd

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feature/rolling-pad
* upstream/main: Save groupby codes after factorizing, pass to flox (pydata#7206) [skip-ci] Add compute to groupby benchmarks (pydata#7690) Delete built-in cfgrib backend (pydata#7670) Added a pronunciation guide to the word Xarray in the README.MD fil… (pydata#7677) boundarynorm fix (pydata#7553) Fix lazy negative slice rewriting. (pydata#7586) [pre-commit.ci] pre-commit autoupdate (pydata#7687) Adjust sidebar font colors (pydata#7674) Bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (pydata#7682) Raise PermissionError when insufficient permissions (pydata#7629)
2 parents b963b29 + 0ac5541 commit d02d2fd

38 files changed

+467
-531
lines changed

.github/workflows/pypi-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
7373
- name: Publish package to TestPyPI
7474
if: github.event_name == 'push'
75-
uses: pypa/[email protected].1
75+
uses: pypa/[email protected].3
7676
with:
7777
user: __token__
7878
password: ${{ secrets.TESTPYPI_TOKEN }}
@@ -90,7 +90,7 @@ jobs:
9090
name: releases
9191
path: dist
9292
- name: Publish package to PyPI
93-
uses: pypa/[email protected].1
93+
uses: pypa/[email protected].3
9494
with:
9595
user: __token__
9696
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/testpypi-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
7979
- name: Publish package to TestPyPI
8080
if: github.event_name == 'push'
81-
uses: pypa/[email protected].1
81+
uses: pypa/[email protected].3
8282
with:
8383
user: __token__
8484
password: ${{ secrets.TESTPYPI_TOKEN }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
files: ^xarray/
1717
- repo: https://github.com/charliermarsh/ruff-pre-commit
1818
# Ruff version.
19-
rev: 'v0.0.257'
19+
rev: 'v0.0.259'
2020
hooks:
2121
- id: ruff
2222
args: ["--fix"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![Examples on binder](https://img.shields.io/badge/launch-binder-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09PX29vb39/f5+fr7+/z8/Pz9/v7+zczCxgAABC5JREFUeAHN1ul3k0UUBvCb1CTVpmpaitAGSLSpSuKCLWpbTKNJFGlcSMAFF63iUmRccNG6gLb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QdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/weather-data.ipynb)
1212
[![Twitter](https://img.shields.io/twitter/follow/xarray_dev?style=social)](https://twitter.com/xarray_dev)
1313

14-
**xarray** (formerly **xray**) is an open source project and Python
14+
**xarray** (pronounced "ex-array", formerly known as **xray**) is an open source project and Python
1515
package that makes working with labelled multi-dimensional arrays
1616
simple, efficient, and fun!
1717

asv_bench/benchmarks/groupby.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# import flox to avoid the cost of first import
2+
import flox.xarray # noqa
13
import numpy as np
24
import pandas as pd
35

@@ -27,24 +29,24 @@ def time_init(self, ndim):
2729
@parameterized(["method", "ndim"], [("sum", "mean"), (1, 2)])
2830
def time_agg_small_num_groups(self, method, ndim):
2931
ds = getattr(self, f"ds{ndim}d")
30-
getattr(ds.groupby("a"), method)()
32+
getattr(ds.groupby("a"), method)().compute()
3133

3234
@parameterized(["method", "ndim"], [("sum", "mean"), (1, 2)])
3335
def time_agg_large_num_groups(self, method, ndim):
3436
ds = getattr(self, f"ds{ndim}d")
35-
getattr(ds.groupby("b"), method)()
37+
getattr(ds.groupby("b"), method)().compute()
3638

3739
def time_binary_op_1d(self):
38-
self.ds1d.groupby("b") - self.ds1d_mean
40+
(self.ds1d.groupby("b") - self.ds1d_mean).compute()
3941

4042
def time_binary_op_2d(self):
41-
self.ds2d.groupby("b") - self.ds2d_mean
43+
(self.ds2d.groupby("b") - self.ds2d_mean).compute()
4244

4345
def peakmem_binary_op_1d(self):
44-
self.ds1d.groupby("b") - self.ds1d_mean
46+
(self.ds1d.groupby("b") - self.ds1d_mean).compute()
4547

4648
def peakmem_binary_op_2d(self):
47-
self.ds2d.groupby("b") - self.ds2d_mean
49+
(self.ds2d.groupby("b") - self.ds2d_mean).compute()
4850

4951

5052
class GroupByDask(GroupBy):
@@ -56,8 +58,8 @@ def setup(self, *args, **kwargs):
5658
self.ds1d["c"] = self.ds1d["c"].chunk({"dim_0": 50})
5759
self.ds2d = self.ds2d.sel(dim_0=slice(None, None, 2))
5860
self.ds2d["c"] = self.ds2d["c"].chunk({"dim_0": 50, "z": 5})
59-
self.ds1d_mean = self.ds1d.groupby("b").mean()
60-
self.ds2d_mean = self.ds2d.groupby("b").mean()
61+
self.ds1d_mean = self.ds1d.groupby("b").mean().compute()
62+
self.ds2d_mean = self.ds2d.groupby("b").mean().compute()
6163

6264

6365
class GroupByPandasDataFrame(GroupBy):
@@ -88,7 +90,7 @@ def setup(self, *args, **kwargs):
8890
requires_dask()
8991
super().setup(**kwargs)
9092
self.ds1d = self.ds1d.chunk({"dim_0": 50}).to_dataframe()
91-
self.ds1d_mean = self.ds1d.groupby("b").mean()
93+
self.ds1d_mean = self.ds1d.groupby("b").mean().compute()
9294

9395
def time_binary_op_2d(self):
9496
raise NotImplementedError
@@ -116,12 +118,12 @@ def time_init(self, ndim):
116118
@parameterized(["method", "ndim"], [("sum", "mean"), (1, 2)])
117119
def time_agg_small_num_groups(self, method, ndim):
118120
ds = getattr(self, f"ds{ndim}d")
119-
getattr(ds.resample(time="3M"), method)()
121+
getattr(ds.resample(time="3M"), method)().compute()
120122

121123
@parameterized(["method", "ndim"], [("sum", "mean"), (1, 2)])
122124
def time_agg_large_num_groups(self, method, ndim):
123125
ds = getattr(self, f"ds{ndim}d")
124-
getattr(ds.resample(time="48H"), method)()
126+
getattr(ds.resample(time="48H"), method)().compute()
125127

126128

127129
class ResampleDask(Resample):

ci/requirements/all-but-dask.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies:
1010
- bottleneck
1111
- cartopy
1212
- cdms2
13-
- cfgrib
1413
- cftime
1514
- coveralls
1615
- flox

ci/requirements/doc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ dependencies:
77
- python=3.10
88
- bottleneck
99
- cartopy
10-
- cfgrib>=0.9
1110
- dask-core>=2022.1
1211
- h5netcdf>=0.13
1312
- ipykernel

ci/requirements/environment-py311.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies:
88
- bottleneck
99
- cartopy
1010
# - cdms2
11-
- cfgrib
1211
- cftime
1312
- dask-core
1413
- distributed

ci/requirements/environment-windows-py311.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ dependencies:
66
- bottleneck
77
- cartopy
88
# - cdms2 # Not available on Windows
9-
# - cfgrib # Causes Python interpreter crash on Windows: https://github.com/pydata/xarray/pull/3340
109
- cftime
1110
- dask-core
1211
- distributed

ci/requirements/environment-windows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ dependencies:
66
- bottleneck
77
- cartopy
88
# - cdms2 # Not available on Windows
9-
# - cfgrib # Causes Python interpreter crash on Windows: https://github.com/pydata/xarray/pull/3340
109
- cftime
1110
- dask-core
1211
- distributed

0 commit comments

Comments
 (0)