Remove special mapping of auto to {} in open_zarr#11010
Remove special mapping of auto to {} in open_zarr#11010jsignell merged 6 commits intopydata:mainfrom
auto to {} in open_zarr#11010Conversation
Co-authored-by: Justus Magin <keewis@users.noreply.github.com>
| from_array_kwargs = {} | ||
|
|
||
| if chunks == "auto": | ||
| if chunks is _default: |
There was a problem hiding this comment.
let's issue a DeprecationWarning saying the default will switch to chunks=None to match open_dataset. If they want the current behaviour with dask et al, users should pass in chunks={}
There was a problem hiding this comment.
Oh I was actually thinking that we not do that part. The issue that we are trying to fix with this PR is really that chunks="auto" means different things in open_zarr and open_dataset(,,, engine="zarr"). That was the part that felt deeply surprising to me and @norlandrhagen. As long as we fix that I don't think we need to change the default value.
There was a problem hiding this comment.
👍 to merging this. It'd be nice to have the default be chunks=None always just like open_dataset. Otherwise we get behaviour that's dependent on the installed packages which is just frustrating
|
Thanks for this PR @jsignell! |
xr.open_zarrandxr.open_dataset(..., engine='zarr')withchunks="auto"#11002whats-new.rstThis PR makes the handling of
chunks="auto"consistent betweenopen_zarrandopen_dataset(..., engine="zarr").The handling of chunks still differs in
open_zarrvsopen_dataset(..., engine="zarr")in that the default inopen_zarris to usechunks={}and a chunk manager (aka dask) when available in your env. And inopen_datasetthe default is to usechunks=None(aka no chunks).