Skip to content

Commit 0783df3

Browse files
committed
Merge branch 'main' into dask-datetime-to-numeric
* main: (24 commits) Fix overflow issue in decode_cf_datetime for dtypes <= np.uint32 (pydata#6598) Enable flox in GroupBy and resample (pydata#5734) Add setuptools as dependency in ASV benchmark CI (pydata#6609) change polyval dim ordering (pydata#6601) re-add timedelta support for polyval (pydata#6599) Minor Dataset.map docstr clarification (pydata#6595) New inline_array kwarg for open_dataset (pydata#6566) Fix polyval overloads (pydata#6593) Restore old MultiIndex dropping behaviour (pydata#6592) [docs] add Dataset.assign_coords example (pydata#6336) (pydata#6558) Fix zarr append dtype checks (pydata#6476) Add missing space in exception message (pydata#6590) Doc Link to accessors list in extending-xarray.rst (pydata#6587) Fix Dataset/DataArray.isel with drop=True and scalar DataArray indexes (pydata#6579) Add some warnings about rechunking to the docs (pydata#6569) [pre-commit.ci] pre-commit autoupdate (pydata#6584) terminology.rst: fix link to Unidata's "netcdf_dataset_components" (pydata#6583) Allow string formatting of scalar DataArrays (pydata#5981) Fix mypy issues & reenable in tests (pydata#6581) polyval: Use Horner's algorithm + support chunked inputs (pydata#6548) ...
2 parents 5cff4f1 + 8de7061 commit 0783df3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1912
-665
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ jobs:
7272
runs-on: "ubuntu-latest"
7373
needs: detect-ci-trigger
7474
# temporarily skipping due to https://github.com/pydata/xarray/issues/6551
75-
# if: needs.detect-ci-trigger.outputs.triggered == 'false'
76-
if: false
75+
if: needs.detect-ci-trigger.outputs.triggered == 'false'
7776
defaults:
7877
run:
7978
shell: bash -l {0}
@@ -105,10 +104,10 @@ jobs:
105104
- name: Install mypy
106105
run: |
107106
python -m pip install mypy
108-
python -m mypy --install-types --non-interactive
109107
110108
- name: Run mypy
111-
run: python -m mypy
109+
run: |
110+
python -m mypy --install-types --non-interactive
112111
113112
min-version-policy:
114113
name: Minimum Version Policy

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
hooks:
2020
- id: isort
2121
- repo: https://github.com/asottile/pyupgrade
22-
rev: v2.32.0
22+
rev: v2.32.1
2323
hooks:
2424
- id: pyupgrade
2525
args:
@@ -46,7 +46,7 @@ repos:
4646
# - id: velin
4747
# args: ["--write", "--compact"]
4848
- repo: https://github.com/pre-commit/mirrors-mypy
49-
rev: v0.942
49+
rev: v0.950
5050
hooks:
5151
- id: mypy
5252
# Copied from setup.cfg

asv_bench/asv.conf.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@
5858
// "pip+emcee": [""], // emcee is only available for install with pip.
5959
// },
6060
"matrix": {
61+
"setuptools_scm[toml]": [""], // GH6609
62+
"setuptools_scm_git_archive": [""], // GH6609
6163
"numpy": [""],
6264
"pandas": [""],
6365
"netcdf4": [""],
6466
"scipy": [""],
6567
"bottleneck": [""],
6668
"dask": [""],
6769
"distributed": [""],
70+
"flox": [""],
71+
"numpy_groupies": [""],
6872
"sparse": [""]
6973
},
7074

asv_bench/benchmarks/groupby.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def setup(self, *args, **kwargs):
1313
{
1414
"a": xr.DataArray(np.r_[np.repeat(1, self.n), np.repeat(2, self.n)]),
1515
"b": xr.DataArray(np.arange(2 * self.n)),
16+
"c": xr.DataArray(np.arange(2 * self.n)),
1617
}
1718
)
1819
self.ds2d = self.ds1d.expand_dims(z=10)
@@ -50,10 +51,11 @@ class GroupByDask(GroupBy):
5051
def setup(self, *args, **kwargs):
5152
requires_dask()
5253
super().setup(**kwargs)
53-
self.ds1d = self.ds1d.sel(dim_0=slice(None, None, 2)).chunk({"dim_0": 50})
54-
self.ds2d = self.ds2d.sel(dim_0=slice(None, None, 2)).chunk(
55-
{"dim_0": 50, "z": 5}
56-
)
54+
55+
self.ds1d = self.ds1d.sel(dim_0=slice(None, None, 2))
56+
self.ds1d["c"] = self.ds1d["c"].chunk({"dim_0": 50})
57+
self.ds2d = self.ds2d.sel(dim_0=slice(None, None, 2))
58+
self.ds2d["c"] = self.ds2d["c"].chunk({"dim_0": 50, "z": 5})
5759
self.ds1d_mean = self.ds1d.groupby("b").mean()
5860
self.ds2d_mean = self.ds2d.groupby("b").mean()
5961

asv_bench/benchmarks/polyfit.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import numpy as np
2+
3+
import xarray as xr
4+
5+
from . import parameterized, randn, requires_dask
6+
7+
NDEGS = (2, 5, 20)
8+
NX = (10**2, 10**6)
9+
10+
11+
class Polyval:
12+
def setup(self, *args, **kwargs):
13+
self.xs = {nx: xr.DataArray(randn((nx,)), dims="x", name="x") for nx in NX}
14+
self.coeffs = {
15+
ndeg: xr.DataArray(
16+
randn((ndeg,)), dims="degree", coords={"degree": np.arange(ndeg)}
17+
)
18+
for ndeg in NDEGS
19+
}
20+
21+
@parameterized(["nx", "ndeg"], [NX, NDEGS])
22+
def time_polyval(self, nx, ndeg):
23+
x = self.xs[nx]
24+
c = self.coeffs[ndeg]
25+
xr.polyval(x, c).compute()
26+
27+
@parameterized(["nx", "ndeg"], [NX, NDEGS])
28+
def peakmem_polyval(self, nx, ndeg):
29+
x = self.xs[nx]
30+
c = self.coeffs[ndeg]
31+
xr.polyval(x, c).compute()
32+
33+
34+
class PolyvalDask(Polyval):
35+
def setup(self, *args, **kwargs):
36+
requires_dask()
37+
super().setup(*args, **kwargs)
38+
self.xs = {k: v.chunk({"x": 10000}) for k, v in self.xs.items()}

ci/install-upstream-wheels.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ conda uninstall -y --force \
1515
pint \
1616
bottleneck \
1717
sparse \
18+
flox \
1819
h5netcdf \
1920
xarray
2021
# to limit the runtime of Upstream CI
@@ -47,4 +48,5 @@ python -m pip install \
4748
git+https://github.com/pydata/sparse \
4849
git+https://github.com/intake/filesystem_spec \
4950
git+https://github.com/SciTools/nc-time-axis \
51+
git+https://github.com/dcherian/flox \
5052
git+https://github.com/h5netcdf/h5netcdf

ci/requirements/all-but-dask.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies:
1313
- cfgrib
1414
- cftime
1515
- coveralls
16+
- flox
1617
- h5netcdf
1718
- h5py
1819
- hdf5

ci/requirements/environment-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies:
1010
- cftime
1111
- dask-core
1212
- distributed
13+
- flox
1314
- fsspec!=2021.7.0
1415
- h5netcdf
1516
- h5py

ci/requirements/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies:
1212
- cftime
1313
- dask-core
1414
- distributed
15+
- flox
1516
- fsspec!=2021.7.0
1617
- h5netcdf
1718
- h5py

ci/requirements/min-all-deps.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,46 @@ dependencies:
1010
- python=3.8
1111
- boto3=1.13
1212
- bottleneck=1.3
13-
# cartopy 0.18 conflicts with pynio
14-
- cartopy=0.17
13+
- cartopy=0.19
1514
- cdms2=3.1
1615
- cfgrib=0.9
17-
- cftime=1.2
16+
- cftime=1.4
1817
- coveralls
19-
- dask-core=2.30
20-
- distributed=2.30
21-
- h5netcdf=0.8
22-
- h5py=2.10
23-
# hdf5 1.12 conflicts with h5py=2.10
18+
- dask-core=2021.04
19+
- distributed=2021.04
20+
- flox=0.5
21+
- h5netcdf=0.11
22+
- h5py=3.1
23+
# hdf5 1.12 conflicts with h5py=3.1
2424
- hdf5=1.10
2525
- hypothesis
2626
- iris=2.4
2727
- lxml=4.6 # Optional dep of pydap
28-
- matplotlib-base=3.3
28+
- matplotlib-base=3.4
2929
- nc-time-axis=1.2
3030
# netcdf follows a 1.major.minor[.patch] convention
3131
# (see https://github.com/Unidata/netcdf4-python/issues/1090)
3232
# bumping the netCDF4 version is currently blocked by #4491
3333
- netcdf4=1.5.3
34-
- numba=0.51
35-
- numpy=1.18
34+
- numba=0.53
35+
- numpy=1.19
3636
- packaging=20.0
37-
- pandas=1.1
38-
- pint=0.16
37+
- pandas=1.2
38+
- pint=0.17
3939
- pip
4040
- pseudonetcdf=3.1
4141
- pydap=3.2
42-
- pynio=1.5
42+
# - pynio=1.5.5
4343
- pytest
4444
- pytest-cov
4545
- pytest-env
4646
- pytest-xdist
47-
- rasterio=1.1
48-
- scipy=1.5
47+
- rasterio=1.2
48+
- scipy=1.6
4949
- seaborn=0.11
50-
- sparse=0.11
50+
- sparse=0.12
5151
- toolz=0.11
5252
- typing_extensions=3.7
53-
- zarr=2.5
53+
- zarr=2.8
5454
- pip:
5555
- numbagg==0.1

0 commit comments

Comments
 (0)