Skip to content

Commit 2ccb756

Browse files
authored
Merge branch 'main' into pre-commit-ci-update-config
2 parents d58ff5b + 31fd606 commit 2ccb756

8 files changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/main.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ jobs:
1414
matrix:
1515
python-version: ["3.11", "3.12", "3.13"]
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818

1919
- name: Setup Python
20-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@v6
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
architecture: x64
2424

2525
- name: Setup pip cache
26-
uses: actions/cache@v4.2.3
26+
uses: actions/cache@v5.0.1
2727
with:
2828
path: ~/.cache/pip
2929
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/dev-requirements.txt') }}
@@ -43,7 +43,7 @@ jobs:
4343
python -m pytest --cov=./ --cov-report=xml --verbose
4444
4545
- name: Upload coverage to Codecov
46-
uses: codecov/codecov-action@v5.4.3
46+
uses: codecov/codecov-action@v5.5.2
4747
with:
4848
file: ./coverage.xml
4949
fail_ci_if_error: false
@@ -55,16 +55,16 @@ jobs:
5555
matrix:
5656
python-version: ["3.11", "3.12", "3.13"]
5757
steps:
58-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@v6
5959

6060
- name: Setup Python
61-
uses: actions/setup-python@v5
61+
uses: actions/setup-python@v6
6262
with:
6363
python-version: ${{ matrix.python-version }}
6464
architecture: x64
6565

6666
- name: Setup pip cache
67-
uses: actions/cache@v4.2.3
67+
uses: actions/cache@v5.0.1
6868
with:
6969
path: ~/.cache/pip
7070
key: ${{ runner.os }}-pip-dev-${{ matrix.python-version }}-${{ hashFiles('**/dev-requirements.txt') }}

.github/workflows/pypipublish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
permissions:
1717
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v6
2020

2121
- name: Set up Python
22-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2323
with:
2424
python-version: "3.x"
2525

docs/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
sphinx<8.0
2-
pydantic<2.0
32
sphinx-autosummary-accessors
43
pydata-sphinx-theme
54
sphinx-autodoc-typehints
6-
autodoc_pydantic==1.9.1
5+
autodoc_pydantic==2.2.0
76
myst-nb
87
sphinx-design
98
sphinx_github_changelog

noxfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def docs(session: nox.Session):
5353
if args.clean:
5454
session.run('rm', '-rf', f'{BUILDDIR}/*')
5555

56+
session.run('python', 'source/api/generate_openapi.py')
57+
5658
if args.live:
5759
session.run('sphinx-autobuild', '-b', 'dirhtml', 'source/', '_build/dirhtml/')
5860
else:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ requires-python = ">=3.11"
2323
classifiers = [
2424
"Development Status :: 4 - Beta",
2525
"Intended Audience :: Science/Research",
26-
"License :: OSI Approved :: MIT License",
26+
"License :: OSI Approved :: Apache Software License",
2727
"Operating System :: OS Independent",
2828
"Programming Language :: Python",
2929
"Programming Language :: Python :: 3 :: Only",

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ pluggy
77
pydantic>=2.5.0
88
toolz
99
uvicorn
10-
xarray>=2025.1.0
10+
xarray>=2025.7.0
1111
zarr>=3.0.7

tests/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_invalid_encoding_chunks_with_dask_raise():
5151
with pytest.raises(ValueError) as excinfo:
5252
_ = create_zmetadata(ds)
5353
excinfo.match(
54-
r"Specified zarr chunks encoding\['chunks'\]=\(8, 5, 1\) for variable named None would overlap multiple dask chunks*"
54+
r"Specified Zarr chunks encoding\['chunks'\]=\[8, 5, 1\] for variable named 'foo' would overlap multiple Dask chunks.*"
5555
)
5656

5757

xpublish/utils/zarr.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import xarray as xr
1818
from numcodecs.abc import Codec
1919
from numcodecs.compat import ensure_ndarray
20+
from xarray.backends.chunks import validate_grid_chunks_alignment
2021
from xarray.backends.zarr import (
2122
DIMENSION_KEY,
2223
encode_zarr_attr_value,
@@ -199,10 +200,18 @@ def create_zmetadata(dataset: xr.Dataset) -> dict:
199200
dvar = da.variable
200201

201202
encoded_da = encode_zarr_variable(dvar, name=key)
203+
if 'chunks' in encoded_da.encoding:
204+
validate_grid_chunks_alignment(
205+
nd_v_chunks=dvar.chunks,
206+
enc_chunks=encoded_da.encoding['chunks'],
207+
region=tuple([SimpleNamespace(start=None, stop=None) for _ in da.shape]),
208+
allow_partial_chunks=False,
209+
name=key,
210+
backend_shape=encoded_da.shape,
211+
)
202212
encoding = extract_zarr_variable_encoding(
203213
dvar,
204214
zarr_format=ZARR_FORMAT,
205-
region=tuple([SimpleNamespace(start=None, stop=None) for _ in da.shape]),
206215
)
207216
zattrs = _extract_dataarray_zattrs(encoded_da)
208217
zattrs = _extract_dataarray_coords(da, zattrs)

0 commit comments

Comments
 (0)