-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
change default in ds.chunk and datarray.chunk variable.chunk #4633
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
Conversation
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 the agreed change to the .chunks
default value.
There is no user change now, as None
is still accepted, but deprecated to avoid that the meaning is different from chunks=None
in xr.open_dataset
.
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.
cc @jhamman for a second look -- we talked about this a few weeks ago
if bad_dims: | ||
raise ValueError( | ||
"some chunks keys are not dimensions on this " "object: %s" % bad_dims | ||
) | ||
|
||
variables = { | ||
k: _maybe_chunk(k, v, chunks, token, lock, name_prefix) |
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.
The style checker is catching that name_prefix
is not defined here.
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.
Yes, sorry, I deleted a line by mistake yesterday, when I have added the inline comment -_-'
Other than a small comment above, this looks good to me. |
The aim is to split the PR #4595 in small PRs.
The scope of this smaller PR is to modify the default of
chunks
indataset.chunk
to align the behaviour toxr.open_dataset
.The main changes are:
dataset.chunk
,datarray.chunk
andvariable.chunk
from None to {}.chunk=None
inside is set to{}
None
will raise an error in the future.Note that the changes currently don't modify the behaviour of
dataset.chunk
isort . && black . && mypy . && flake8