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

Chunk control minor fixes #5593

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/iris/_lazy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def _optimum_chunksize_internals(

Args:

* chunks (tuple of int, or None):
Pre-existing chunk shape of the target data : None if unknown.
* chunks (tuple of int):
Pre-existing chunk shape of the target data.
* shape (tuple of int):
The full array shape of the target data.
* limit (int):
Expand Down Expand Up @@ -106,8 +106,6 @@ def _optimum_chunksize_internals(
"chunks = [c[0] for c in normalise_chunks('auto', ...)]".

"""
if chunks is None:
chunks = list(shape)

# Set the chunksize limit.
if limit is None:
Expand Down
10 changes: 8 additions & 2 deletions lib/iris/fileformats/netcdf/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,13 @@ def set(
@contextmanager
def from_file(self) -> None:
"""
Ensures the chunks are loaded in from file variables, else will throw an error.
Ensures the chunksizes are loaded in from NetCDF file variables.

Raises
------
KeyError
If any NetCDF data variables - those that become
:class:`~iris.cube.Cube`\\ s - do not specify chunksizes.

Notes
-----
Expand All @@ -798,7 +804,7 @@ def from_file(self) -> None:
@contextmanager
def as_dask(self) -> None:
"""
Ensures the chunks are decided from dask.
Uses Dask :external+dask:doc:`array` to control chunksizes.

Notes
-----
Expand Down
Loading