Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ Bug Fixes

Documentation
~~~~~~~~~~~~~
- Document how :py:meth:`Dataset.interp` and :py:meth:`DataArray.interp` handle
chunks of Dask arrays, and that loading chunked new coordinates first can
reduce the memory use for ``method="linear"`` and ``"nearest"``
(:pull:`11786`).
By `Michael Niklas <https://github.com/headtr1ck>`_.
- Clarified that :py:meth:`DataArray.item` and :py:meth:`Variable.item` are not
implemented for lazy (e.g. dask) arrays, both in the method docstring and in the
raised error message, which now suggests loading the data into memory first
Expand Down
6 changes: 6 additions & 0 deletions xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2429,6 +2429,12 @@ def interp(
- When interpolating along multiple dimensions with methods `linear` and `nearest`,
the process attempts to decompose the interpolation into independent interpolations
along one dimension at a time.
- For Dask arrays, the chunks along the interpolated dimensions are merged
into a single chunk. With methods `linear` and `nearest`, the data is
first subset to the range of the new coordinates, so only the chunks that
are needed are read. This only happens if the new coordinates are in
memory, so loading chunked new coordinates first (e.g. with ``.compute()``)
can reduce the memory use considerably if they are cheap to compute.
- The specific interpolation method and dimensionality determine which
interpolant is used:

Expand Down
6 changes: 6 additions & 0 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3895,6 +3895,12 @@ def interp(
- When interpolating along multiple dimensions with methods `linear` and `nearest`,
the process attempts to decompose the interpolation into independent interpolations
along one dimension at a time.
- For Dask arrays, the chunks along the interpolated dimensions are merged
into a single chunk. With methods `linear` and `nearest`, the data is
first subset to the range of the new coordinates, so only the chunks that
are needed are read. This only happens if the new coordinates are in
memory, so loading chunked new coordinates first (e.g. with ``.compute()``)
can reduce the memory use considerably if they are cheap to compute.
- The specific interpolation method and dimensionality determine which
interpolant is used:

Expand Down
Loading