Skip to content

Commit 4bea2b3

Browse files
committed
Update docs
1 parent 2aa143f commit 4bea2b3

4 files changed

Lines changed: 16 additions & 29 deletions

File tree

doc/whats-new.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ v2026.05.0 (unreleased)
1414
New Features
1515
~~~~~~~~~~~~
1616

17-
- Adds a new option ``chunks="preserve"`` when opening a dataset. This option
18-
guarantees that chunks in xarray match on-disk chunks or multiples of them.
19-
No chunk splitting allowed. (:pull:`11060`).
17+
- Change behavior of ``chunks="auto"`` to guarantee that chunks in xarray
18+
match on-disk chunks or multiples of them. No automatic chunk splitting allowed.
19+
(:pull:`11060`).
2020
By `Julia Signell <https://github.com/jsignell>`_
21-
- Added ``inherit='all_coords'`` option to :py:meth:`DataTree.to_dataset` to inherit
22-
all parent coordinates, not just indexed ones (:issue:`10812`, :pull:`11230`).
23-
By `Alfonso Ladino <https://github.com/aladinor>`_.
2421

2522
Breaking Changes
2623
~~~~~~~~~~~~~~~~

xarray/backends/api.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,12 @@ def open_dataset(
430430
"netcdf4" over "h5netcdf" over "scipy" (customizable via
431431
``netcdf_engine_order`` in ``xarray.set_options()``). A custom backend
432432
class (a subclass of ``BackendEntrypoint``) can also be used.
433-
chunks : int, dict, 'auto', 'dask-auto' or None, default: None
433+
chunks : int, dict, 'auto', or None, default: None
434434
If provided, used to load the data into dask arrays.
435435
436436
- ``chunks="auto"`` will use a chunking scheme that never splits encoded
437437
chunks. If encoded chunks are small then "auto" takes multiples of them
438438
over the largest dimension.
439-
- ``chunks="dask-auto"`` will use dask ``auto`` chunking taking into account the
440-
engine preferred chunks.
441439
- ``chunks=None`` skips using dask. This uses xarray's internally private
442440
:ref:`lazy indexing classes <internal design.lazy indexing>`,
443441
but data is eagerly loaded into memory as numpy arrays when accessed.
@@ -677,14 +675,12 @@ def open_dataarray(
677675
"netcdf4" over "h5netcdf" over "scipy" (customizable via
678676
``netcdf_engine_order`` in ``xarray.set_options()``). A custom backend
679677
class (a subclass of ``BackendEntrypoint``) can also be used.
680-
chunks : int, dict, 'auto', 'dask-auto', or None, default: None
678+
chunks : int, dict, 'auto', or None, default: None
681679
If provided, used to load the data into dask arrays.
682680
683681
- ``chunks="auto"`` will use a chunking scheme that never splits encoded
684682
chunks. If encoded chunks are small then "auto" takes multiples of them
685683
over the largest dimension.
686-
- ``chunks='dask-auto'`` will use dask ``auto`` chunking taking into account the
687-
engine preferred chunks.
688684
- ``chunks=None`` skips using dask. This uses xarray's internally private
689685
:ref:`lazy indexing classes <internal design.lazy indexing>`,
690686
but data is eagerly loaded into memory as numpy arrays when accessed.
@@ -906,11 +902,9 @@ def open_datatree(
906902
"h5netcdf" over "netcdf4" (customizable via ``netcdf_engine_order`` in
907903
``xarray.set_options()``). A custom backend class (a subclass of
908904
``BackendEntrypoint``) can also be used.
909-
chunks : int, dict, 'auto', 'dask-auto', or None, default: None
905+
chunks : int, dict, 'auto', or None, default: None
910906
If provided, used to load the data into dask arrays.
911907
912-
- ``chunks="dask-auto"`` will use dask ``auto`` chunking taking into account the
913-
engine preferred chunks.
914908
- ``chunks="auto"`` will use a chunking scheme that never splits encoded
915909
chunks. If encoded chunks are small then "auto" takes multiples of them
916910
over the largest dimension.
@@ -1155,14 +1149,12 @@ def open_groups(
11551149
``xarray.set_options()``). A custom backend class (a subclass of
11561150
``BackendEntrypoint``) can also be used.
11571151
can also be used.
1158-
chunks : int, dict, 'auto', 'dask-auto', or None, default: None
1152+
chunks : int, dict, 'auto', or None, default: None
11591153
If provided, used to load the data into dask arrays.
11601154
11611155
- ``chunks="auto"`` will use a chunking scheme that never splits encoded
11621156
chunks. If encoded chunks are small then "auto" takes multiples of them
11631157
over the largest dimension.
1164-
- ``chunks="dask-auto"`` will use dask ``auto`` chunking taking into account the
1165-
engine preferred chunks.
11661158
- ``chunks=None`` skips using dask. This uses xarray's internally private
11671159
:ref:`lazy indexing classes <internal design.lazy indexing>`,
11681160
but data is eagerly loaded into memory as numpy arrays when accessed.
@@ -1430,7 +1422,7 @@ def open_mfdataset(
14301422
concatenation along more than one dimension is desired, then ``paths`` must be a
14311423
nested list-of-lists (see ``combine_nested`` for details). (A string glob will
14321424
be expanded to a 1-dimensional list.)
1433-
chunks : int, dict, 'auto', 'dask-auto', or None, optional
1425+
chunks : int, dict, 'auto', or None, optional
14341426
Dictionary with keys given by dimension names and values given by chunk sizes.
14351427
In general, these should divide the dimensions of each dataset. If int, chunk
14361428
each dimension by ``chunks``. By default, chunks will be chosen to match the

xarray/backends/zarr.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,15 +1499,13 @@ def open_zarr(
14991499
Array synchronizer provided to zarr
15001500
group : str, optional
15011501
Group path. (a.k.a. `path` in zarr terminology.)
1502-
chunks : int, dict, "auto", "dask-auto", or None, optional
1502+
chunks : int, dict, "auto", or None, optional
15031503
Used to load the data into dask arrays. Default behavior is to use
15041504
``chunks={}`` if dask is available, otherwise ``chunks=None``.
15051505
15061506
- ``chunks="auto"`` will use a chunking scheme that never splits encoded
15071507
chunks. If encoded chunks are small then "auto" takes multiples of them
15081508
over the largest dimension.
1509-
- ``chunks='dask-auto'`` will use dask ``auto`` chunking taking into account the
1510-
engine preferred chunks.
15111509
- ``chunks=None`` skips using dask. This uses xarray's internally private
15121510
:ref:`lazy indexing classes <internal design.lazy indexing>`,
15131511
but data is eagerly loaded into memory as numpy arrays when accessed.

xarray/namedarray/parallelcompat.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -797,18 +797,18 @@ def preserve_chunks(
797797
"""Quickly determine optimal chunks close to target size but never splitting
798798
previous_chunks.
799799
800-
This takes in a chunks argument potentially containing ``"preserve"`` for several
801-
dimensions. This function replaces ``"preserve"`` with concrete dimension sizes that
800+
This takes in a chunks argument potentially containing ``"auto"`` for several
801+
dimensions. This function replaces ``"auto"`` with concrete dimension sizes that
802802
try to get chunks to be close to certain size in bytes, provided by the ``target=``
803-
keyword. Any dimensions marked as ``"preserve"`` will potentially be multiplied
803+
keyword. Any dimensions marked as ``"auto"`` will potentially be multiplied
804804
by some factor to get close to the byte target, while never splitting
805805
``previous_chunks``. If chunks are non-uniform along a particular dimension
806806
then that dimension will always use exactly ``previous_chunks``.
807807
808808
Examples
809809
--------
810810
>>> ChunkManagerEntrypoint.preserve_chunks(
811-
... chunks=("preserve", "preserve", "preserve"),
811+
... chunks=("auto", "auto", "auto"),
812812
... shape=(1280, 1280, 20),
813813
... target=500 * 1024,
814814
... typesize=8,
@@ -817,7 +817,7 @@ def preserve_chunks(
817817
(128, 128, 2)
818818
819819
>>> ChunkManagerEntrypoint.preserve_chunks(
820-
... chunks=("preserve", "preserve", 1),
820+
... chunks=("auto", "auto", 1),
821821
... shape=(1280, 1280, 20),
822822
... target=1 * 1024 * 1024,
823823
... typesize=8,
@@ -826,7 +826,7 @@ def preserve_chunks(
826826
(128, 1024, 1)
827827
828828
>>> ChunkManagerEntrypoint.preserve_chunks(
829-
... chunks=("preserve", "preserve", 1),
829+
... chunks=("auto", "auto", 1),
830830
... shape=(1280, 1280, 20),
831831
... target=1 * 1024 * 1024,
832832
... typesize=8,
@@ -838,7 +838,7 @@ def preserve_chunks(
838838
----------
839839
chunks: tuple[int | str | tuple[int], ...]
840840
A tuple of either dimensions or tuples of explicit chunk dimensions
841-
Some entries should be "preserve".
841+
Some entries should be "auto".
842842
shape: tuple[int]
843843
The shape of the array
844844
target: int

0 commit comments

Comments
 (0)