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

Remove maybe chunck duplicated function #4494

Merged
merged 8 commits into from
Oct 8, 2020
Merged

Remove maybe chunck duplicated function #4494

merged 8 commits into from
Oct 8, 2020

Conversation

aurghs
Copy link
Collaborator

@aurghs aurghs commented Oct 7, 2020

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 function dataset.chunks and as method of zarr.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 module dataset.

@@ -359,6 +359,39 @@ def _assert_empty(args: tuple, msg: str = "%s") -> None:
raise ValueError(msg % args)


def _selkeys(dict_, keys):
Copy link
Collaborator

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.

Copy link
Member

@shoyer shoyer left a 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!

@max-sixty
Copy link
Collaborator

@aurghs if you'd like to add an entry to whatsnew, please feel free. We'll plan to merge tomorrow. Thanks!

@shoyer shoyer merged commit 49e3032 into pydata:master Oct 8, 2020
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.

4 participants