Skip to content

Commit 4eef318

Browse files
committed
Merge branch 'main' of https://github.com/pydata/xarray
2 parents f769f85 + 08fa7b9 commit 4eef318

35 files changed

+1359
-554
lines changed

.github/workflows/nightly-wheels.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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: |

ci/install-upstream-wheels.sh

Lines changed: 1 addition & 1 deletion
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 \

doc/getting-started-guide/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ To open format X file in xarray, you need to know the `format of the data <https
191191
:header: "File Format", "Open via", " Related Packages"
192192
:widths: 15, 45, 15
193193

194-
"NetCDF (.nc, .nc4, .cdf)","``open_dataset()`` OR ``open_mfdataset()``", "`netCDF4 <https://pypi.org/project/netCDF4/>`_, `netcdf <https://pypi.org/project/netcdf/>`_ , `cdms2 <https://cdms.readthedocs.io/en/latest/cdms2.html>`_"
194+
"NetCDF (.nc, .nc4, .cdf)","``open_dataset()`` OR ``open_mfdataset()``", "`netCDF4 <https://pypi.org/project/netCDF4/>`_, `cdms2 <https://cdms.readthedocs.io/en/latest/cdms2.html>`_"
195195
"HDF5 (.h5, .hdf5)","``open_dataset()`` OR ``open_mfdataset()``", "`h5py <https://www.h5py.org/>`_, `pytables <https://www.pytables.org/>`_ "
196196
"GRIB (.grb, .grib)", "``open_dataset()``", "`cfgrib <https://pypi.org/project/cfgrib/>`_, `pygrib <https://pypi.org/project/pygrib/>`_"
197197
"CSV (.csv)","``open_dataset()``", "`pandas`_ , `dask <https://www.dask.org/>`_"

doc/user-guide/indexing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ indexing for xarray is based on our
376376
:ref:`broadcasting rules <compute.broadcasting>`.
377377
See :ref:`indexing.rules` for the complete specification.
378378

379-
.. _NumPy's advanced indexing: https://numpy.org/doc/stable/reference/arrays.indexing.html
379+
.. _NumPy's advanced indexing: https://numpy.org/doc/stable/user/basics.indexing.html#advanced-indexing
380380

381381
Vectorized indexing also works with ``isel``, ``loc``, and ``sel``:
382382

doc/user-guide/io.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,22 @@ reads. Because this fall-back option is so much slower, xarray issues a
10211021
instead of falling back to try reading non-consolidated metadata.
10221022

10231023

1024+
Fill Values
1025+
~~~~~~~~~~~
1026+
1027+
Zarr arrays have a ``fill_value`` that is used for chunks that were never written to disk.
1028+
For the Zarr version 2 format, Xarray will set ``fill_value`` to be equal to the CF/NetCDF ``"_FillValue"``.
1029+
This is ``np.nan`` by default for floats, and unset otherwise. Note that the Zarr library will set a
1030+
default ``fill_value`` if not specified (usually ``0``).
1031+
1032+
For the Zarr version 3 format, ``_FillValue`` and ```fill_value`` are decoupled.
1033+
So you can set ``fill_value`` in ``encoding`` as usual.
1034+
1035+
Note that at read-time, you can control whether ``_FillValue`` is masked using the
1036+
``mask_and_scale`` kwarg; and whether Zarr's ``fill_value`` is treated as synonymous
1037+
with ``_FillValue`` using the ``use_zarr_fill_value_as_mask`` kwarg to :py:func:`xarray.open_zarr`.
1038+
1039+
10241040
.. _io.kerchunk:
10251041

10261042
Kerchunk

doc/whats-new.rst

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,20 @@ What's New
1414
1515
np.random.seed(123456)
1616
17-
.. _whats-new.2025.03.1:
17+
.. _whats-new.2025.04.0:
1818

19-
v2025.03.1 (unreleased)
19+
v2025.04.0 (unreleased)
2020
-----------------------
2121

2222
New Features
2323
~~~~~~~~~~~~
2424

25+
- Added `scipy-stubs <https://github.com/scipy/scipy-stubs>`_ to the ``xarray[types]`` dependencies.
26+
By `Joren Hammudoglu <https://github.com/jorenham>`_.
2527

2628
Breaking changes
2729
~~~~~~~~~~~~~~~~
2830

29-
- Explicitly forbid appending a :py:class:`~xarray.DataTree` to zarr using :py:meth:`~xarray.DataTree.to_zarr` with ``append_dim``, because the expected behaviour is currently undefined.
30-
(:issue:`9858`, :pull:`10156`)
31-
By `Tom Nicholas <https://github.com/TomNicholas>`_.
3231

3332
Deprecations
3433
~~~~~~~~~~~~
@@ -45,6 +44,43 @@ Documentation
4544
Internal Changes
4645
~~~~~~~~~~~~~~~~
4746

47+
.. _whats-new.2025.03.1:
48+
49+
v2025.03.1 (Mar 30, 2025)
50+
-------------------------
51+
52+
This release brings the ability to specify ``fill_value`` and ``write_empty_chunks`` for Zarr V3 stores, and a few bug fixes.
53+
Thanks to the 10 contributors to this release:
54+
Andrecho, Deepak Cherian, Ian Hunt-Isaak, Karl Krauth, Mathias Hauser, Maximilian Roos, Nick Hodgskin (🦎 Vecko), Spencer Clark, Tom Nicholas and wpbonelli.
55+
56+
New Features
57+
~~~~~~~~~~~~
58+
59+
- Allow setting a ``fill_value`` for Zarr format 3 arrays. Specify ``fill_value`` in ``encoding`` as usual.
60+
(:issue:`10064`). By `Deepak Cherian <https://github.com/dcherian>`_.
61+
62+
Breaking changes
63+
~~~~~~~~~~~~~~~~
64+
65+
- Explicitly forbid appending a :py:class:`~xarray.DataTree` to zarr using :py:meth:`~xarray.DataTree.to_zarr` with ``append_dim``, because the expected behaviour is currently undefined.
66+
(:issue:`9858`, :pull:`10156`)
67+
By `Tom Nicholas <https://github.com/TomNicholas>`_.
68+
69+
Bug fixes
70+
~~~~~~~~~
71+
72+
- Update the parameters of :py:meth:`~xarray.DataArray.to_zarr` to match :py:meth:`~xarray.Dataset.to_zarr`.
73+
This fixes the issue where using the ``zarr_version`` parameter would raise a deprecation warning telling the user to use
74+
a non-existent ``zarr_format`` parameter instead. (:issue:`10163`, :pull:`10164`)
75+
By `Karl Krauth <https://github.com/Karl-Krauth>`_.
76+
- :py:meth:`DataTree.sel` and :py:meth:`DataTree.isel` display the path of the first failed node again (:pull:`10154`).
77+
By `Mathias Hauser <https://github.com/mathause>`_.
78+
- Fix grouped and resampled ``first``, ``last`` with datetimes (:issue:`10169`, :pull:`10173`)
79+
By `Deepak Cherian <https://github.com/dcherian>`_.
80+
- FacetGrid plots now include units in their axis labels when available (:issue:`10184`, :pull:`10185`)
81+
By `Andre Wendlinger <https://github.com/andrewendlinger>`_.
82+
83+
4884
.. _whats-new.2025.03.0:
4985

5086
v2025.03.0 (Mar 20, 2025)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ parallel = ["dask[complete]"]
4545
viz = ["cartopy", "matplotlib", "nc-time-axis", "seaborn"]
4646
types = [
4747
"pandas-stubs",
48+
"scipy-stubs",
4849
"types-PyYAML",
4950
"types-Pygments",
5051
"types-colorama",
@@ -276,11 +277,10 @@ ignore = [
276277
"RUF001", # string contains ambiguous unicode character
277278
"RUF002", # docstring contains ambiguous acute accent unicode character
278279
"RUF003", # comment contains ambiguous no-break space unicode character
279-
"RUF005", # consider upacking operator instead of concatenation
280+
"RUF005", # consider unpacking operator instead of concatenation
280281
"RUF012", # mutable class attributes
281282
]
282283

283-
284284
[tool.ruff.lint.per-file-ignores]
285285
# don't enforce absolute imports
286286
"asv_bench/**" = ["TID252"]

xarray/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
cross,
2525
dot,
2626
polyval,
27-
unify_chunks,
2827
where,
2928
)
3029
from xarray.conventions import SerializationWarning, decode_cf
@@ -52,6 +51,7 @@
5251
from xarray.core.variable import IndexVariable, Variable, as_variable
5352
from xarray.namedarray.core import NamedArray
5453
from xarray.structure.alignment import align, broadcast
54+
from xarray.structure.chunks import unify_chunks
5555
from xarray.structure.combine import combine_by_coords, combine_nested
5656
from xarray.structure.concat import concat
5757
from xarray.structure.merge import Context, MergeError, merge

xarray/backends/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from xarray.backends.locks import _get_scheduler
3636
from xarray.coders import CFDatetimeCoder, CFTimedeltaCoder
3737
from xarray.core import indexing
38-
from xarray.core.chunk import _get_chunk, _maybe_chunk
3938
from xarray.core.dataarray import DataArray
4039
from xarray.core.dataset import Dataset
4140
from xarray.core.datatree import DataTree
@@ -45,6 +44,7 @@
4544
from xarray.core.utils import is_remote_uri
4645
from xarray.namedarray.daskmanager import DaskManager
4746
from xarray.namedarray.parallelcompat import guess_chunkmanager
47+
from xarray.structure.chunks import _get_chunk, _maybe_chunk
4848
from xarray.structure.combine import (
4949
_infer_concat_order_from_positions,
5050
_nested_combine,

0 commit comments

Comments
 (0)