We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ValueError
1 parent dbb98b4 commit 2c8f2e8Copy full SHA for 2c8f2e8
xarray/core/dataarray.py
@@ -1444,6 +1444,11 @@ def chunk(
1444
"It will raise an error in the future. Instead use a dict with dimension names as keys.",
1445
category=DeprecationWarning,
1446
)
1447
+ if len(chunks) != len(self.dims):
1448
+ raise ValueError(
1449
+ f"chunks must have the same number of elements as dimensions. "
1450
+ f"Expected {len(self.dims)} elements, got {len(chunks)}."
1451
+ )
1452
chunk_mapping = dict(zip(self.dims, chunks, strict=True))
1453
else:
1454
chunk_mapping = either_dict_or_kwargs(chunks, chunks_kwargs, "chunk")
0 commit comments