-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove maybe chunck duplicated function #4494
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
Remove maybe chunck duplicated function #4494
Conversation
add in maybechunk the key overwrite_encoded_chunks for zarr
xarray/core/dataset.py
Outdated
@@ -359,6 +359,39 @@ def _assert_empty(args: tuple, msg: str = "%s") -> None: | |||
raise ValueError(msg % args) | |||
|
|||
|
|||
def _selkeys(dict_, keys): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you only moved this helper function out, but I would take the occasion to move the logic back into _maybe_chunk
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice cleanup, thank you!
@aurghs if you'd like to add an entry to whatsnew, please feel free. We'll plan to merge tomorrow. Thanks! |
I propose this small change with a view to unifying in
open_dataset
the logic of zarr chunking with that of the other backends.Currently, the function
maybe_chunk
is duplicated: it is defined inside the functiondataset.chunks
and as method ofzarr.ZarrStore
. This last function has been added with the recent merge of #4187 .I merged the two functions in a private function
_maybe_chunk
inside the moduledataset
.isort . && black . && mypy . && flake8