Skip to content

Commit 1f7d7f3

Browse files
committed
Merge branch 'main' into fix-7794
* main: (76 commits) Update how-to-add-new-backend.rst (#10240) Support extension array indexes (#9671) Switch documentation to pydata-sphinx-theme (#8708) Bump codecov/codecov-action from 5.4.0 to 5.4.2 in the actions group (#10239) Fix mypy, min-versions CI, xfail Zarr tests (#10255) Remove `test_dask_layers_and_dependencies` (#10242) Fix: Docs generation create temporary files that are not cleaned up. (#10238) opendap / dap4 support for pydap backend (#10182) Add RangeIndex (#10076) Fix mypy (#10232) Fix doctests (#10230) Fix broken Sphinx Roles (#10225) `DatasetView.map` fix `keep_attrs` (#10219) Add datatree repr asv (#10214) CI: Automatic PR labelling is back (#10201) Fixes dimension order in `xarray.Dataset.to_stacked_array` (#10205) Fix references to core classes in docs (#10207) Update pre-commit hooks (#10208) add `scipy-stubs` as extra `[types]` dependency (#10202) Fix sparse dask repr test (#10200) ...
2 parents 6c4bdf2 + 97f02b4 commit 1f7d7f3

File tree

161 files changed

+6460
-3533
lines changed

Some content is hidden

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

161 files changed

+6460
-3533
lines changed

.github/labeler.yml

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
Automation:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- .github/**
5+
6+
CI:
7+
- changed-files:
8+
- any-glob-to-any-file:
9+
- ci/**
10+
11+
dependencies:
12+
- changed-files:
13+
- any-glob-to-any-file:
14+
- ci/requirements/*
15+
16+
topic-arrays:
17+
- changed-files:
18+
- any-glob-to-any-file:
19+
- xarray/core/duck_array_ops.py
20+
21+
topic-backends:
22+
- changed-files:
23+
- any-glob-to-any-file:
24+
- xarray/backends/**
25+
26+
topic-cftime:
27+
- changed-files:
28+
- any-glob-to-any-file:
29+
- xarray/coding/*time*
30+
31+
topic-CF conventions:
32+
- changed-files:
33+
- any-glob-to-any-file:
34+
- xarray/conventions.py
35+
36+
topic-dask:
37+
- changed-files:
38+
- any-glob-to-any-file:
39+
- xarray/compat/dask*
40+
- xarray/core/parallel.py
41+
42+
topic-DataTree:
43+
- changed-files:
44+
- any-glob-to-any-file:
45+
- xarray/core/datatree*
46+
47+
topic-documentation:
48+
- changed-files:
49+
- any-glob-to-any-file:
50+
- doc/*
51+
- "!doc/whats-new.rst"
52+
- doc/**/*
53+
54+
topic-groupby:
55+
- changed-files:
56+
- any-glob-to-any-file:
57+
- xarray/core/groupby.py
58+
59+
topic-html-repr:
60+
- changed-files:
61+
- any-glob-to-any-file:
62+
- xarray/core/formatting_html.py
63+
64+
topic-hypothesis:
65+
- changed-files:
66+
- any-glob-to-any-file:
67+
- properties/**
68+
- xarray/testing/strategies.py
69+
70+
topic-indexing:
71+
- changed-files:
72+
- any-glob-to-any-file:
73+
- xarray/core/indexes.py
74+
- xarray/core/indexing.py
75+
76+
topic-NamedArray:
77+
- changed-files:
78+
- any-glob-to-any-file:
79+
- xarray/namedarray/*
80+
81+
topic-performance:
82+
- changed-files:
83+
- any-glob-to-any-file:
84+
- asv_bench/benchmarks/**
85+
86+
topic-plotting:
87+
- changed-files:
88+
- any-glob-to-any-file:
89+
- xarray/plot/*
90+
- xarray/plot/**/*
91+
92+
topic-rolling:
93+
- changed-files:
94+
- any-glob-to-any-file:
95+
- xarray/computation/rolling.py
96+
- xarray/computation/rolling_exp.py
97+
98+
topic-testing:
99+
- changed-files:
100+
- any-glob-to-any-file:
101+
- conftest.py
102+
- xarray/testing/*
103+
104+
topic-typing:
105+
- changed-files:
106+
- any-glob-to-any-file:
107+
- xarray/core/types.py
108+
109+
topic-zarr:
110+
- changed-files:
111+
- any-glob-to-any-file:
112+
- xarray/backends/zarr.py
113+
114+
io:
115+
- changed-files:
116+
- any-glob-to-any-file:
117+
- xarray/backends/**

.github/workflows/benchmarks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010

1111
jobs:
1212
benchmark:
13-
if: ${{ contains( github.event.pull_request.labels.*.name, 'run-benchmark') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
13+
if: ${{ contains( github.event.pull_request.labels.*.name, 'run-benchmark') && github.event_name == 'pull_request' || contains( github.event.pull_request.labels.*.name, 'topic-performance') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
1414
name: Linux
1515
runs-on: ubuntu-20.04
1616
env:

.github/workflows/ci-additional.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
124124
125125
- name: Upload mypy coverage to Codecov
126-
uses: codecov/codecov-action@v5.3.1
126+
uses: codecov/codecov-action@v5.4.2
127127
with:
128128
file: mypy_report/cobertura.xml
129129
flags: mypy
@@ -174,7 +174,7 @@ jobs:
174174
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
175175
176176
- name: Upload mypy coverage to Codecov
177-
uses: codecov/codecov-action@v5.3.1
177+
uses: codecov/codecov-action@v5.4.2
178178
with:
179179
file: mypy_report/cobertura.xml
180180
flags: mypy-min
@@ -230,7 +230,7 @@ jobs:
230230
python -m pyright xarray/
231231
232232
- name: Upload pyright coverage to Codecov
233-
uses: codecov/codecov-action@v5.3.1
233+
uses: codecov/codecov-action@v5.4.2
234234
with:
235235
file: pyright_report/cobertura.xml
236236
flags: pyright
@@ -286,7 +286,7 @@ jobs:
286286
python -m pyright xarray/
287287
288288
- name: Upload pyright coverage to Codecov
289-
uses: codecov/codecov-action@v5.3.1
289+
uses: codecov/codecov-action@v5.4.2
290290
with:
291291
file: pyright_report/cobertura.xml
292292
flags: pyright39

.github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ jobs:
172172
path: pytest.xml
173173

174174
- name: Upload code coverage to Codecov
175-
uses: codecov/codecov-action@v5.3.1
175+
uses: codecov/codecov-action@v5.4.2
176176
env:
177177
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
178178
with:

.github/workflows/label-prs.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "PR Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
label:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/labeler@v5
10+
with:
11+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
12+
sync-labels: false

.github/workflows/nightly-wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
fi
3939
4040
- name: Upload wheel
41-
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # 0.6.1
41+
uses: scientific-python/upload-nightly-action@b36e8c0c10dbcfd2e05bf95f17ef8c14fd708dbf # 0.6.2
4242
with:
4343
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_NIGHTLY }}
4444
artifacts_path: dist

.github/workflows/upstream-dev-ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
if: success()
8585
id: status
8686
run: |
87-
python -m pytest --timeout=60 -rf \
87+
python -m pytest --timeout=60 -rf -nauto \
8888
--report-log output-${{ matrix.python-version }}-log.jsonl
8989
- name: Generate and publish the report
9090
if: |
@@ -140,7 +140,7 @@ jobs:
140140
run: |
141141
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
142142
- name: Upload mypy coverage to Codecov
143-
uses: codecov/codecov-action@v5.3.1
143+
uses: codecov/codecov-action@v5.4.2
144144
with:
145145
file: mypy_report/cobertura.xml
146146
flags: mypy

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,8 @@ doc/team-panel.txt
8181
doc/external-examples-gallery.txt
8282
doc/notebooks-examples-gallery.txt
8383
doc/videos-gallery.txt
84+
85+
# Until we support this properly, excluding from gitignore. (adding it to
86+
# gitignore to make it _easier_ to work with `uv`, not as an indication that I
87+
# think we shouldn't...)
88+
uv.lock

.pre-commit-config.yaml

+10-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
- id: text-unicode-replacement-char
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
2727
# Ruff version.
28-
rev: v0.9.4
28+
rev: v0.11.4
2929
hooks:
3030
- id: ruff-format
3131
- id: ruff
@@ -37,12 +37,12 @@ repos:
3737
exclude: "generate_aggregations.py"
3838
additional_dependencies: ["black==24.8.0"]
3939
- repo: https://github.com/rbubley/mirrors-prettier
40-
rev: v3.4.2
40+
rev: v3.5.3
4141
hooks:
4242
- id: prettier
4343
args: [--cache-location=.prettier_cache/cache]
4444
- repo: https://github.com/pre-commit/mirrors-mypy
45-
rev: v1.14.1
45+
rev: v1.15.0
4646
hooks:
4747
- id: mypy
4848
# Copied from setup.cfg
@@ -69,7 +69,13 @@ repos:
6969
- id: taplo-format
7070
args: ["--option", "array_auto_collapse=false"]
7171
- repo: https://github.com/abravalheri/validate-pyproject
72-
rev: v0.23
72+
rev: v0.24.1
7373
hooks:
7474
- id: validate-pyproject
7575
additional_dependencies: ["validate-pyproject-schema-store[all]"]
76+
- repo: https://github.com/crate-ci/typos
77+
rev: v1
78+
hooks:
79+
- id: typos
80+
# https://github.com/crate-ci/typos/issues/347
81+
pass_filenames: false

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# xarray: N-D labeled arrays and datasets
22

3-
[![CI](https://github.com/pydata/xarray/workflows/CI/badge.svg?branch=main)](https://github.com/pydata/xarray/actions?query=workflow%3ACI)
3+
[![CI](https://github.com/pydata/xarray/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/pydata/xarray/actions/workflows/ci.yaml?query=branch%3Amain)
44
[![Code coverage](https://codecov.io/gh/pydata/xarray/branch/main/graph/badge.svg?flag=unittests)](https://codecov.io/gh/pydata/xarray)
55
[![Docs](https://readthedocs.org/projects/xray/badge/?version=latest)](https://docs.xarray.dev/)
6-
[![Benchmarked with asv](https://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat)](https://pandas.pydata.org/speed/xarray/)
6+
[![Benchmarked with asv](https://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat)](https://asv-runner.github.io/asv-collection/xarray/)
77
[![Formatted with black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
88
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
99
[![Available on pypi](https://img.shields.io/pypi/v/xarray.svg)](https://pypi.python.org/pypi/xarray/)

asv_bench/benchmarks/repr.py

+19
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@ def time_repr_html(self):
2525
self.ds._repr_html_()
2626

2727

28+
class ReprDataTree:
29+
def setup(self):
30+
# construct a datatree with 500 nodes
31+
number_of_files = 20
32+
number_of_groups = 25
33+
tree_dict = {}
34+
for f in range(number_of_files):
35+
for g in range(number_of_groups):
36+
tree_dict[f"file_{f}/group_{g}"] = xr.Dataset({"g": f * g})
37+
38+
self.dt = xr.DataTree.from_dict(tree_dict)
39+
40+
def time_repr(self):
41+
repr(self.dt)
42+
43+
def time_repr_html(self):
44+
self.dt._repr_html_()
45+
46+
2847
class ReprMultiIndex:
2948
def setup(self):
3049
index = pd.MultiIndex.from_product(

ci/install-upstream-wheels.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ python -m pip install \
5353
git+https://github.com/dask/dask \
5454
git+https://github.com/dask/dask-expr \
5555
git+https://github.com/dask/distributed \
56-
git+https://github.com/zarr-developers/zarr \
56+
git+https://github.com/zarr-developers/zarr-python \
5757
git+https://github.com/Unidata/cftime \
5858
git+https://github.com/pypa/packaging \
5959
git+https://github.com/hgrecco/pint \

ci/minimum_versions.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020

2121
channels = ["conda-forge"]
2222
platforms = ["noarch", "linux-64"]
23+
# these packages don't fail the CI, but will be printed in the report
24+
ignore_failure_packages = [
25+
# remove when we can pin to pydap 3.5.1 without error
26+
"pydap",
27+
]
28+
# these packages are completely ignored
2329
ignored_packages = [
2430
"coveralls",
2531
"pip",
@@ -171,7 +177,11 @@ def compare_versions(environments, policy_versions):
171177
status = {}
172178
for env, specs in environments.items():
173179
env_status = any(
174-
spec.version > policy_versions[spec.name].version for spec in specs
180+
(
181+
(spec.version > policy_versions[spec.name].version)
182+
and (spec.name not in ignore_failure_packages)
183+
)
184+
for spec in specs
175185
)
176186
status[env] = env_status
177187
return status

ci/requirements/doc.yml

+14-13
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,50 @@ channels:
44
- conda-forge
55
- nodefaults
66
dependencies:
7-
- python=3.12
7+
- python
88
- bottleneck
99
- cartopy
1010
- cfgrib
1111
- kerchunk
12-
- dask-core>=2022.1
13-
- hypothesis>=6.75.8
14-
- h5netcdf>=0.13
12+
- dask-core
13+
- hypothesis
14+
- h5netcdf
1515
- ipykernel
1616
- ipywidgets # silence nbsphinx warning
1717
- ipython
18-
- iris>=2.3
18+
- iris
1919
- jupyter_client
20+
- jupyter_sphinx
2021
- matplotlib-base
2122
- nbsphinx
2223
- ncdata
23-
- netcdf4>=1.5
24+
- netcdf4
2425
- numba
2526
- numpy>=2
26-
- packaging>=23.2
27-
- pandas>=1.4,!=2.1.0
27+
- packaging
28+
- pandas
2829
- pooch
2930
- pip
3031
- pre-commit
3132
- pyarrow
33+
- pydata-sphinx-theme
3234
- pyproj
3335
- rich # for Zarr tree()
34-
- scipy!=1.10.0
36+
- scipy
3537
- seaborn
3638
- setuptools
3739
- sparse
3840
- sphinx-autosummary-accessors
39-
- sphinx-book-theme<=1.0.1
4041
- sphinx-copybutton
4142
- sphinx-design
4243
- sphinx-inline-tabs
43-
- sphinx>=5.0,<7.0 # https://github.com/executablebooks/sphinx-book-theme/issues/749
44+
- sphinx>=6,<8
45+
- sphinxcontrib-mermaid
4446
- sphinxcontrib-srclinks
4547
- sphinx-remove-toctrees
4648
- sphinxext-opengraph
4749
- sphinxext-rediraffe
48-
- zarr>=2.10
50+
- zarr
4951
- pip:
50-
- sphinxcontrib-mermaid
5152
# relative to this file. Needs to be editable to be accepted.
5253
- -e ../..

0 commit comments

Comments
 (0)