Skip to content

Commit 9db3004

Browse files
committed
fix docstring RasterSchema.parse()
1 parent d98785d commit 9db3004

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/spatialdata/models/models.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,16 @@ def parse(
122122
are `[2, 2, 2]`, the returned multiscale image will have 4 scales. The original image and then the 2x, 4x
123123
and 8x downsampled images.
124124
method
125-
Method to use for multiscale downsampling (default is `'nearest'`). Please refer to
126-
:class:`multiscale_spatial_image.to_multiscale` for details.\n
127-
Note (advanced): the default choice (`'nearest'`) will keep the original scale lazy and compute each
128-
downscaled version. On the other hand `'xarray_coarsen'` will compute each scale lazily (this implies that
129-
each scale will be recomputed each time it is accessed unless `.persist()` is manually called to cache the
130-
intermediate results). Please refer direclty to the source code of `to_multiscale()` in the
131-
`multiscale-spatial-image` for precise information on how this is handled.
125+
Method to use for multiscale downsampling. If ``None`` (the default), a lazy implementation is used
126+
(based on ``ome-zarr-py``'s ``resize()``). This computes all scales lazily, using linear interpolation
127+
(``order=1``) for images and nearest-neighbor interpolation (``order=0``) for labels.
128+
129+
If a :class:`~multiscale_spatial_image.to_multiscale.to_multiscale.Methods` value is passed, the
130+
``multiscale_spatial_image.to_multiscale()`` implementation is used instead. For example, the previous
131+
default behavior (spatialdata <= 0.7.2) can be replicated by passing ``method=Methods.XARRAY_COARSEN`` for
132+
images or ``method=Methods.DASK_IMAGE_NEAREST`` for labels. As of multiscale-spatial-image==2.0.3,
133+
``method=Method.DASK_IMAGE_NEAREST`` is not lazy (leading to high memory usage), therefore the new defaults
134+
are preferred.
132135
chunks
133136
Chunks to use for dask array.
134137
kwargs

0 commit comments

Comments
 (0)