-
-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -362,7 +362,7 @@ def _assert_empty(args: tuple, msg: str = "%s") -> None: | |
def _maybe_chunk( | ||
name, | ||
var, | ||
chunks=None, | ||
chunks, | ||
token=None, | ||
lock=None, | ||
name_prefix="xarray-", | ||
|
@@ -1819,11 +1819,10 @@ def chunks(self) -> Mapping[Hashable, Tuple[int, ...]]: | |
def chunk( | ||
self, | ||
chunks: Union[ | ||
None, | ||
Number, | ||
str, | ||
Mapping[Hashable, Union[None, Number, str, Tuple[Number, ...]]], | ||
] = None, | ||
] = {}, | ||
name_prefix: str = "xarray-", | ||
token: str = None, | ||
lock: bool = False, | ||
|
@@ -1855,17 +1854,22 @@ def chunk( | |
------- | ||
chunked : xarray.Dataset | ||
""" | ||
if chunks is None: | ||
warnings.warn( | ||
"None value for 'chunks' is deprecated. " | ||
"It will raise an error in the future. Use instead '{}'", | ||
category=FutureWarning, | ||
) | ||
chunks = {} | ||
|
||
if isinstance(chunks, (Number, str)): | ||
chunks = dict.fromkeys(self.dims, chunks) | ||
|
||
if chunks is not None: | ||
bad_dims = chunks.keys() - self.dims.keys() | ||
if bad_dims: | ||
raise ValueError( | ||
"some chunks keys are not dimensions on this " | ||
"object: %s" % bad_dims | ||
) | ||
bad_dims = chunks.keys() - self.dims.keys() | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. The style checker is catching that There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 -_-' |
||
|
Uh oh!
There was an error while loading. Please reload this page.