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

Chunks do not add up to shape. Got chunks=((), (), (240,)), shape=(960, 1200, 240) #510

Open
wewe-sst opened this issue Apr 21, 2023 · 1 comment

Comments

@wewe-sst
Copy link

2023-04-21 04:58:09 ERROR Failed to complete
Traceback (most recent call last):
File "d:\anaconda3\lib\site-packages\climate_indices_main_.py", line 1688, in main
compute_write_index(kwrgs)
File "d:\anaconda3\lib\site-packages\climate_indices_main
.py", line 722, in compute_write_index
dataset = xr.open_mfdataset(files, chunks=chunks)
File "d:\anaconda3\lib\site-packages\xarray\backends\api.py", line 948, in open_mfdataset
datasets = [open
(p, **open_kwargs) for p in paths]
File "d:\anaconda3\lib\site-packages\xarray\backends\api.py", line 948, in
datasets = [open_(p, **open_kwargs) for p in paths]
File "d:\anaconda3\lib\site-packages\xarray\backends\api.py", line 575, in open_dataset
ds = maybe_decode_store(store, chunks)
File "d:\anaconda3\lib\site-packages\xarray\backends\api.py", line 509, in maybe_decode_store
ds2 = ds.chunk(chunks, name_prefix=name_prefix, token=token)
File "d:\anaconda3\lib\site-packages\xarray\core\dataset.py", line 1872, in chunk
for k, v in self.variables.items()
File "d:\anaconda3\lib\site-packages\xarray\core\dataset.py", line 1872, in
for k, v in self.variables.items()
File "d:\anaconda3\lib\site-packages\xarray\core\dataset.py", line 381, in _maybe_chunk
var = var.chunk(chunks, name=name2, lock=lock)
File "d:\anaconda3\lib\site-packages\xarray\core\variable.py", line 1053, in chunk
data = da.from_array(data, chunks, name=name, lock=lock, **kwargs)
File "d:\anaconda3\lib\site-packages\dask\array\core.py", line 1805, in from_array
"Got chunks=%s, shape=%s" % (chunks, x.shape))
ValueError: Chunks do not add up to shape. Got chunks=((), (), (240,)), shape=(960, 1200, 240)

@monocongo
Copy link
Owner

Perhaps you are using an older version? Can you please re-install from the master branch and report whether or not this solved your issue?

If you post a link to your dataset then I may be able to test this out myself. It's not clear yet whether or not this is an issue with our code or with the input data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants