Skip to content
forked from pydata/xarray

Commit 88e56d8

Browse files
authored
Merge branch 'main' into rolling-auto-rechunk
2 parents 1bdd60b + 2619c0b commit 88e56d8

File tree

104 files changed

+1207
-867
lines changed

Some content is hidden

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

104 files changed

+1207
-867
lines changed

.github/ISSUE_TEMPLATE/bugreport.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ body:
3737
Please confirm that the bug report is in an excellent state, so we can understand & fix it quickly & efficiently. For more details, check out:
3838
3939
- [Minimal Complete Verifiable Examples](https://stackoverflow.com/help/mcve)
40-
- [Craft Minimal Bug Reports](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
40+
- [Craft Minimal Bug Reports](https://matthewrocklin.com/minimal-bug-reports)
4141
4242
options:
4343
- label: Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.

.github/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ newIssueWelcomeComment: >
1414
newPRWelcomeComment: >
1515
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
1616
17-
If you have questions, some answers may be found in our [contributing guidelines](http://docs.xarray.dev/en/stable/contributing.html).
17+
If you have questions, some answers may be found in our [contributing guidelines](https://docs.xarray.dev/en/stable/contributing.html).
1818
1919
# Comment to be posted to on pull requests merged by a first time user
2020
firstPRMergeComment: >

.github/workflows/benchmarks-last-release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- name: Set up conda environment
2525
uses: mamba-org/setup-micromamba@v2
2626
with:
27+
micromamba-version: '1.5.10-0'
2728
environment-file: ${{env.CONDA_ENV_FILE}}
2829
environment-name: xarray-tests
2930
cache-environment: true

.github/workflows/benchmarks.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- name: Set up conda environment
2828
uses: mamba-org/setup-micromamba@v2
2929
with:
30+
micromamba-version: '1.5.10-0'
3031
environment-file: ${{env.CONDA_ENV_FILE}}
3132
environment-name: xarray-tests
3233
cache-environment: true
@@ -35,7 +36,7 @@ jobs:
3536
create-args: >-
3637
asv
3738
python-build
38-
mamba
39+
mamba<=1.5.10
3940
4041
4142
- name: Run benchmarks

.github/workflows/ci-additional.yaml

+4-16
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161
environment-name: xarray-tests
6262
create-args: >-
6363
python=${{env.PYTHON_VERSION}}
64-
conda
6564
cache-environment: true
6665
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
6766

@@ -70,8 +69,6 @@ jobs:
7069
python -m pip install --no-deps -e .
7170
- name: Version info
7271
run: |
73-
conda info -a
74-
conda list
7572
python xarray/util/print_versions.py
7673
- name: Run doctests
7774
run: |
@@ -109,16 +106,13 @@ jobs:
109106
environment-name: xarray-tests
110107
create-args: >-
111108
python=${{env.PYTHON_VERSION}}
112-
conda
113109
cache-environment: true
114110
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
115111
- name: Install xarray
116112
run: |
117113
python -m pip install --no-deps -e .
118114
- name: Version info
119115
run: |
120-
conda info -a
121-
conda list
122116
python xarray/util/print_versions.py
123117
- name: Install mypy
124118
run: |
@@ -163,16 +157,13 @@ jobs:
163157
environment-name: xarray-tests
164158
create-args: >-
165159
python=${{env.PYTHON_VERSION}}
166-
conda
167160
cache-environment: true
168161
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
169162
- name: Install xarray
170163
run: |
171164
python -m pip install --no-deps -e .
172165
- name: Version info
173166
run: |
174-
conda info -a
175-
conda list
176167
python xarray/util/print_versions.py
177168
- name: Install mypy
178169
run: |
@@ -222,16 +213,13 @@ jobs:
222213
environment-name: xarray-tests
223214
create-args: >-
224215
python=${{env.PYTHON_VERSION}}
225-
conda
226216
cache-environment: true
227217
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
228218
- name: Install xarray
229219
run: |
230220
python -m pip install --no-deps -e .
231221
- name: Version info
232222
run: |
233-
conda info -a
234-
conda list
235223
python xarray/util/print_versions.py
236224
- name: Install pyright
237225
run: |
@@ -281,16 +269,13 @@ jobs:
281269
environment-name: xarray-tests
282270
create-args: >-
283271
python=${{env.PYTHON_VERSION}}
284-
conda
285272
cache-environment: true
286273
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
287274
- name: Install xarray
288275
run: |
289276
python -m pip install --no-deps -e .
290277
- name: Version info
291278
run: |
292-
conda info -a
293-
conda list
294279
python xarray/util/print_versions.py
295280
- name: Install pyright
296281
run: |
@@ -326,12 +311,15 @@ jobs:
326311
- name: Setup micromamba
327312
uses: mamba-org/setup-micromamba@v2
328313
with:
314+
# run with micromamba 1.5.10 together with conda
315+
# conda.api is not API compatible with libmambapy
316+
micromamba-version: "1.5.10-0"
329317
environment-name: xarray-tests
330318
create-args: >-
331319
python=3.12
332320
pyyaml
333-
conda
334321
python-dateutil
322+
conda
335323
336324
- name: All-deps minimum versions policy
337325
run: |

.github/workflows/ci.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ jobs:
116116
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
117117
create-args: >-
118118
python=${{matrix.python-version}}
119-
conda
120119
121120
# We only want to install this on one run, because otherwise we'll have
122121
# duplicate annotations.
@@ -131,8 +130,6 @@ jobs:
131130
132131
- name: Version info
133132
run: |
134-
conda info -a
135-
conda list
136133
python xarray/util/print_versions.py
137134
138135
- name: Import xarray

.github/workflows/hypothesis.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ jobs:
7676
python -m pip install --no-deps -e .
7777
- name: Version info
7878
run: |
79-
conda info -a
80-
conda list
8179
python xarray/util/print_versions.py
8280
8381
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache

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

-6
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ jobs:
6868
create-args: >-
6969
python=${{ matrix.python-version }}
7070
pytest-reportlog
71-
conda
7271
- name: Install upstream versions
7372
run: |
7473
bash ci/install-upstream-wheels.sh
@@ -77,8 +76,6 @@ jobs:
7776
python -m pip install --no-deps -e .
7877
- name: Version info
7978
run: |
80-
conda info -a
81-
conda list
8279
python xarray/util/print_versions.py
8380
- name: Import xarray
8481
run: |
@@ -127,7 +124,6 @@ jobs:
127124
create-args: >-
128125
python=${{ matrix.python-version }}
129126
pytest-reportlog
130-
conda
131127
- name: Install upstream versions
132128
run: |
133129
bash ci/install-upstream-wheels.sh
@@ -136,8 +132,6 @@ jobs:
136132
python -m pip install --no-deps -e .
137133
- name: Version info
138134
run: |
139-
conda info -a
140-
conda list
141135
python xarray/util/print_versions.py
142136
- name: Install mypy
143137
run: |

CODE_OF_CONDUCT.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
4040

4141
## Attribution
4242

43-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
4444

45-
[homepage]: http://contributor-covenant.org
46-
[version]: http://contributor-covenant.org/version/1/4/
45+
[homepage]: https://contributor-covenant.org
46+
[version]: https://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Xarray's contributor guidelines [can be found in our online documentation](http://docs.xarray.dev/en/stable/contributing.html)
1+
Xarray's contributor guidelines [can be found in our online documentation](https://docs.xarray.dev/en/stable/contributing.html)

DATATREE_MIGRATION_GUIDE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ A number of other API changes have been made, which should only require minor mo
4141
- The method `DataTree.to_dataset()` still exists but now has different options for controlling which variables are present on the resulting `Dataset`, e.g. `inherit=True/False`.
4242
- `DataTree.copy()` also has a new `inherit` keyword argument for controlling whether or not coordinates defined on parents are copied (only relevant when copying a non-root node).
4343
- The `DataTree.parent` property is now read-only. To assign a ancestral relationships directly you must instead use the `.children` property on the parent node, which remains settable.
44-
- Similarly the `parent` kwarg has been removed from the `DataTree.__init__` constuctor.
44+
- Similarly the `parent` kwarg has been removed from the `DataTree.__init__` constructor.
4545
- DataTree objects passed to the `children` kwarg in `DataTree.__init__` are now shallow-copied.
4646
- `DataTree.as_array` has been replaced by `DataTree.to_dataarray`.
4747
- A number of methods which were not well tested have been (temporarily) disabled. In general we have tried to only keep things that are known to work, with the plan to increase API surface incrementally after release.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ our efforts.
9494
## History
9595

9696
Xarray is an evolution of an internal tool developed at [The Climate
97-
Corporation](http://climate.com/). It was originally written by Climate
97+
Corporation](https://climate.com/). It was originally written by Climate
9898
Corp researchers Stephan Hoyer, Alex Kleeman and Eugene Brevdo and was
9999
released as open source in May 2014. The project was renamed from
100100
"xray" in January 2016. Xarray became a fiscally sponsored project of

asv_bench/asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"project": "xarray",
88

99
// The project's homepage
10-
"project_url": "http://docs.xarray.dev/",
10+
"project_url": "https://docs.xarray.dev/",
1111

1212
// The URL or local path of the source code repository for the
1313
// project being benchmarked

asv_bench/benchmarks/dataset_io.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def load(self) -> tuple:
712712
dims=("time",),
713713
fastpath=True,
714714
)
715-
for v in range(0, n_variables)
715+
for v in range(n_variables)
716716
}
717717
attributes = {}
718718

@@ -722,7 +722,7 @@ class PerformanceBackend(xr.backends.BackendEntrypoint):
722722
def open_dataset(
723723
self,
724724
filename_or_obj: str | os.PathLike | None,
725-
drop_variables: tuple[str, ...] = None,
725+
drop_variables: tuple[str, ...] | None = None,
726726
*,
727727
mask_and_scale=True,
728728
decode_times=True,

asv_bench/benchmarks/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# import flox to avoid the cost of first import
22
import cftime
3-
import flox.xarray # noqa
3+
import flox.xarray # noqa: F401
44
import numpy as np
55
import pandas as pd
66

ci/min_deps_check.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def parse_requirements(fname) -> Iterator[tuple[str, int, int, int | None]]:
6262
pkg, eq, version = row.partition("=")
6363
if pkg.rstrip("<>") in IGNORE_DEPS:
6464
continue
65-
if pkg.endswith("<") or pkg.endswith(">") or eq != "=":
65+
if pkg.endswith(("<", ">")) or eq != "=":
6666
error("package should be pinned with exact version: " + row)
6767
continue
6868

@@ -186,7 +186,7 @@ def process_pkg(
186186
)
187187

188188

189-
def fmt_version(major: int, minor: int, patch: int = None) -> str:
189+
def fmt_version(major: int, minor: int, patch: int | None = None) -> str:
190190
if patch is None:
191191
return f"{major}.{minor}"
192192
else:

ci/requirements/all-but-dask.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- nodefaults
55
dependencies:
66
- aiobotocore
7-
- array-api-strict
7+
- array-api-strict<=2.1
88
- boto3
99
- bottleneck
1010
- cartopy

ci/requirements/all-but-numba.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
# Pin a "very new numpy" (updated Sept 24, 2024)
77
- numpy>=2.1.1
88
- aiobotocore
9-
- array-api-strict
9+
- array-api-strict<=2.1
1010
- boto3
1111
- bottleneck
1212
- cartopy

ci/requirements/environment-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: xarray-tests
22
channels:
33
- conda-forge
44
dependencies:
5-
- array-api-strict
5+
- array-api-strict<=2.1
66
- boto3
77
- bottleneck
88
- cartopy

ci/requirements/environment.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- nodefaults
55
dependencies:
66
- aiobotocore
7-
- array-api-strict
7+
- array-api-strict<=2.1
88
- boto3
99
- bottleneck
1010
- cartopy
@@ -36,14 +36,7 @@ dependencies:
3636
- pre-commit
3737
- pyarrow # pandas raises a deprecation warning without this, breaking doctests
3838
- pydap
39-
# start pydap server dependencies, can be removed if pydap-server is available
40-
- gunicorn
41-
- PasteDeploy
42-
- docopt-ng
43-
- Webob
44-
- Jinja2
45-
- beautifulsoup4
46-
# end pydap server dependencies
39+
- pydap-server
4740
- pytest
4841
- pytest-cov
4942
- pytest-env

design_notes/flexible_indexes_notes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ A possible, more explicit solution to reuse a `pandas.MultiIndex` in a DataArray
133133

134134
New indexes may also be built from existing sets of coordinates or variables in a Dataset/DataArray using the `.set_index()` method.
135135

136-
The [current signature](http://docs.xarray.dev/en/stable/generated/xarray.DataArray.set_index.html#xarray.DataArray.set_index) of `.set_index()` is tailored to `pandas.MultiIndex` and tied to the concept of a dimension-index. It is therefore hardly reusable as-is in the context of flexible indexes proposed here.
136+
The [current signature](https://docs.xarray.dev/en/stable/generated/xarray.DataArray.set_index.html#xarray.DataArray.set_index) of `.set_index()` is tailored to `pandas.MultiIndex` and tied to the concept of a dimension-index. It is therefore hardly reusable as-is in the context of flexible indexes proposed here.
137137

138138
The new signature may look like one of these:
139139

0 commit comments

Comments
 (0)