Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify zarr chunking as suggested in #4496 #4646

Merged
merged 10 commits into from
Dec 9, 2020
Merged

Modify zarr chunking as suggested in #4496 #4646

merged 10 commits into from
Dec 9, 2020

Conversation

aurghs
Copy link
Collaborator

@aurghs aurghs commented Dec 3, 2020

Part of #4595
The changes involve only open_dataset(..., engine=zarr) (and marginally open_zarr), in particular, _get_chunks has been modified to fit #4496 (comment) option 1 chunking behaviour and align open_dataset chunking with dataset.chunk:

  • with auto it uses dask auto-chunking (if a preferred_chunking is defined, dask will take it into account as done in dataset.chunk)
  • with -1 it uses dask but no chunking.
  • with {} it uses the backend encoded chunks (when available) for on-disk data (xr.open_dataset) and the current chunking for already opened datasets (ds.chunk)

Add some test

@@ -2172,6 +2179,10 @@ def test_open_zarr_use_cftime(self):
ds_b = xr.open_zarr(store_target, consolidated=True, use_cftime=True)
assert xr.coding.times.contains_cftime_datetimes(ds_b.time)

@requires_dask
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use xfail instead, because this is a real limitation with the current implementation.

@alexamici alexamici merged commit 9802411 into pydata:master Dec 9, 2020
@aurghs aurghs mentioned this pull request Dec 23, 2020
2 tasks
@aurghs aurghs deleted the harmonize-zarr-chunking branch February 11, 2021 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants