monocongo / climate_indices

Climate indices for drought monitoring
https://monocongo.github.io/climate_indices/
Other
353 stars 167 forks source link

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

Open wewe-sst opened 1 year ago

wewe-sst commented 1 year ago

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 openmfdataset datasets = [open(p, openkwargs) 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 commented 1 year ago

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.