Skip to content

Commit 1ffe5e9

Browse files
committed
Merge branch 'main' into backend-indexing
* main: (79 commits) fix mean for datetime-like using the respective time resolution unit (#9977) Add `time_unit` argument to `CFTimeIndex.to_datetimeindex` (#9965) remove gate and add a test (#9958) Remove repetitive that (replace it with the) (#9994) add shxarray to the xarray ecosystem list (#9995) Add `shards` to `valid_encodings` to enable sharded Zarr writing (#9948) Use flox for grouped first, last (#9986) Bump the actions group with 2 updates (#9989) Fix some typing (#9988) Remove unnecessary a article (#9980) Fix test_doc_example on big-endian systems (#9949) fix weighted polyfit for arrays with more than 2 dimensions (#9974) Use zarr-fixture to prevent thread leakage errors (#9967) remove dask-expr from CI runs, fix related tests (#9971) Update time coding tests to assert exact equality (#9961) cast type to PDDatetimeUnitOptions (#9963) Suggest the correct name when no key matches in the dataset (#9943) fix upstream dev issues (#9953) Relax nanosecond datetime restriction in CF time decoding (#9618) Remove outdated quantile test. (#9945) ...
2 parents fb24e9c + e28f171 commit 1ffe5e9

File tree

109 files changed

+5158
-2131
lines changed

Some content is hidden

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

109 files changed

+5158
-2131
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 4 additions & 4 deletions
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.0.2
126+
uses: codecov/codecov-action@v5.3.1
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.0.2
177+
uses: codecov/codecov-action@v5.3.1
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.0.2
233+
uses: codecov/codecov-action@v5.3.1
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.0.2
289+
uses: codecov/codecov-action@v5.3.1
290290
with:
291291
file: pyright_report/cobertura.xml
292292
flags: pyright39

.github/workflows/ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ jobs:
159159
path: pytest.xml
160160

161161
- name: Upload code coverage to Codecov
162-
uses: codecov/[email protected]
162+
uses: codecov/[email protected]
163+
env:
164+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
163165
with:
164166
file: ./coverage.xml
165167
flags: unittests

.github/workflows/pypi-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
path: dist
8989
- name: Publish package to TestPyPI
9090
if: github.event_name == 'push'
91-
uses: pypa/[email protected].2
91+
uses: pypa/[email protected].4
9292
with:
9393
repository_url: https://test.pypi.org/legacy/
9494
verbose: true
@@ -110,6 +110,6 @@ jobs:
110110
name: releases
111111
path: dist
112112
- name: Publish package to PyPI
113-
uses: pypa/[email protected].2
113+
uses: pypa/[email protected].4
114114
with:
115115
verbose: true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.0.2
143+
uses: codecov/codecov-action@v5.3.1
144144
with:
145145
file: mypy_report/cobertura.xml
146146
flags: mypy

.pre-commit-config.yaml

Lines changed: 13 additions & 3 deletions
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.7.2
28+
rev: v0.8.6
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.3.3
40+
rev: v3.4.2
4141
hooks:
4242
- id: prettier
4343
args: [--cache-location=.prettier_cache/cache]
4444
- repo: https://github.com/pre-commit/mirrors-mypy
45-
rev: v1.13.0
45+
rev: v1.14.1
4646
hooks:
4747
- id: mypy
4848
# Copied from setup.cfg
@@ -63,3 +63,13 @@ repos:
6363
rev: ebf0b5e44d67f8beaa1cd13a0d0393ea04c6058d
6464
hooks:
6565
- id: validate-cff
66+
- repo: https://github.com/ComPWA/taplo-pre-commit
67+
rev: v0.9.3
68+
hooks:
69+
- id: taplo-format
70+
args: ["--option", "array_auto_collapse=false"]
71+
- repo: https://github.com/abravalheri/validate-pyproject
72+
rev: v0.23
73+
hooks:
74+
- id: validate-pyproject
75+
additional_dependencies: ["validate-pyproject-schema-store[all]"]

.readthedocs.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
version: 2
22

3+
sphinx:
4+
configuration: doc/conf.py
5+
fail_on_warning: true
6+
37
build:
48
os: ubuntu-lts-latest
59
tools:
@@ -14,7 +18,4 @@ build:
1418
conda:
1519
environment: ci/requirements/doc.yml
1620

17-
sphinx:
18-
fail_on_warning: true
19-
2021
formats: []

DATATREE_MIGRATION_GUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ A number of other API changes have been made, which should only require minor mo
4545
- 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.
4646
- Similarly the `parent` kwarg has been removed from the `DataTree.__init__` constructor.
4747
- DataTree objects passed to the `children` kwarg in `DataTree.__init__` are now shallow-copied.
48+
- `DataTree.map_over_subtree` has been renamed to `DataTree.map_over_datasets`, and changed to no longer work like a decorator. Instead you use it to apply the function and arguments directly, more like how `xarray.apply_ufunc` works.
4849
- `DataTree.as_array` has been replaced by `DataTree.to_dataarray`.
4950
- 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.
5051

asv_bench/benchmarks/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def requires_sparse():
3030

3131

3232
def randn(shape, frac_nan=None, chunks=None, seed=0):
33-
rng = np.random.RandomState(seed)
33+
rng = np.random.default_rng(seed)
3434
if chunks is None:
3535
x = rng.standard_normal(shape)
3636
else:
3737
import dask.array as da
3838

39-
rng = da.random.RandomState(seed)
39+
rng = da.random.default_rng(seed)
4040
x = rng.standard_normal(shape, chunks=chunks)
4141

4242
if frac_nan is not None:
@@ -47,8 +47,8 @@ def randn(shape, frac_nan=None, chunks=None, seed=0):
4747

4848

4949
def randint(low, high=None, size=None, frac_minus=None, seed=0):
50-
rng = np.random.RandomState(seed)
51-
x = rng.randint(low, high, size)
50+
rng = np.random.default_rng(seed)
51+
x = rng.integers(low, high, size)
5252
if frac_minus is not None:
5353
inds = rng.choice(range(x.size), int(x.size * frac_minus))
5454
x.flat[inds] = -1

asv_bench/benchmarks/dataset_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def make_ds(self, nfiles=10):
305305
ds.attrs = {"history": "created for xarray benchmarking"}
306306

307307
self.ds_list.append(ds)
308-
self.filenames_list.append("test_netcdf_%i.nc" % i)
308+
self.filenames_list.append(f"test_netcdf_{i}.nc")
309309

310310

311311
class IOWriteMultipleNetCDF3(IOMultipleNetCDF):

asv_bench/benchmarks/reindexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class Reindex:
1313
def setup(self):
14-
data = np.random.RandomState(0).randn(ntime, nx, ny)
14+
data = np.random.default_rng(0).random((ntime, nx, ny))
1515
self.ds = xr.Dataset(
1616
{"temperature": (("time", "x", "y"), data)},
1717
coords={"time": np.arange(ntime), "x": np.arange(nx), "y": np.arange(ny)},

0 commit comments

Comments
 (0)