You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File c:\Users\olive\miniconda3\envs\atlite-test\Lib\site-packages\xarray\core\dataarray.py:479, in DataArray.init(self, data, coords, dims, name, attrs, indexes, fastpath)
477 data = _check_data_shape(data, coords, dims)
478 data = as_compatible_data(data)
--> 479 coords, dims = _infer_coords_and_dims(data.shape, coords, dims)
480 variable = Variable(dims, data, attrs, fastpath=True)
482 if not isinstance(coords, Coordinates):
File c:\Users\olive\miniconda3\envs\atlite-test\Lib\site-packages\xarray\core\dataarray.py:163, in _infer_coords_and_dims(shape, coords, dims)
156 """All the logic for creating a new DataArray"""
158 if (
159 coords is not None
160 and not utils.is_dict_like(coords)
161 and len(coords) != len(shape)
162 ):
--> 163 raise ValueError(
164 f"coords is not dict-like, but it has {len(coords)} items, "
165 f"which does not match the {len(shape)} dimensions of the "
166 "data"
167 )
169 if isinstance(dims, str):
170 dims = (dims,)
ValueError: coords is not dict-like, but it has 3 items, which does not match the 4 dimensions of the data
Any idea how this could be solved?
And in the meantime: Do you know a combination of package versions for which this issue should not occur?
Version Checks (indicate both or one)
I have confirmed this bug exists on the lastest release of Atlite.
I have confirmed this bug exists on the current
master
branch of Atlite.Issue Description
I am trying to run the examples/landuse-availability.ipynb
The cell in which the availability matrix is calculated throws the following error:
ValueError Traceback (most recent call last)
Cell In[11], line 1
----> 1 A = cutout.availabilitymatrix(shapes, excluder)
2 A
File c:\Users\olive\miniconda3\envs\atlite-test\Lib\site-packages\atlite\gis.py:761, in compute_availabilitymatrix(cutout, shapes, excluder, nprocesses, disable_progressbar)
759 availability = np.stack(availability)[:, ::-1] # flip axis, see Notes
760 coords = [(shapes.index), ("y", cutout.data.y.data), ("x", cutout.data.x.data)]
--> 761 return xr.DataArray(availability, coords=coords)
File c:\Users\olive\miniconda3\envs\atlite-test\Lib\site-packages\xarray\core\dataarray.py:479, in DataArray.init(self, data, coords, dims, name, attrs, indexes, fastpath)
477 data = _check_data_shape(data, coords, dims)
478 data = as_compatible_data(data)
--> 479 coords, dims = _infer_coords_and_dims(data.shape, coords, dims)
480 variable = Variable(dims, data, attrs, fastpath=True)
482 if not isinstance(coords, Coordinates):
File c:\Users\olive\miniconda3\envs\atlite-test\Lib\site-packages\xarray\core\dataarray.py:163, in _infer_coords_and_dims(shape, coords, dims)
156 """All the logic for creating a new DataArray"""
158 if (
159 coords is not None
160 and not utils.is_dict_like(coords)
161 and len(coords) != len(shape)
162 ):
--> 163 raise ValueError(
164 f"coords is not dict-like, but it has {len(coords)} items, "
165 f"which does not match the {len(shape)} dimensions of the "
166 "data"
167 )
169 if isinstance(dims, str):
170 dims = (dims,)
ValueError: coords is not dict-like, but it has 3 items, which does not match the 4 dimensions of the data
Any idea how this could be solved?
And in the meantime: Do you know a combination of package versions for which this issue should not occur?
Reproducible Example
Expected Behavior
No response
Installed Versions
name: atlite-test
channels:
dependencies:
prefix: C:\Users\olive\miniconda3\envs\atlite-test
The text was updated successfully, but these errors were encountered: