regrid_dataset broken with xarray=0.16.1
See original GitHub issueFirst off, thanks everyone for keeping this great package going!
Unfortunately, regridding of chunked/dask datasets seems to have broken with the latest 0.16.1 xarray release, maybe related to #4060?
Minimal Example
import xarray as xr
import xesmf as xe
ds = xr.tutorial.open_dataset('air_temperature').chunk({'time':1})
ds['foo'] = ds.air # adding a second field breaks regridder call
grid = xr.Dataset({'lat': (['lat'], ds.lat[::4]), 'lon': (['lon'], ds.lon[::4])})
regridder = xe.Regridder(ds, grid, 'bilinear')
ds_out = regridder(ds)
Fails with:
Traceback (most recent call last):
File "test.py", line 8, in <module>
ds_out = regridder(ds)
File "/home/slevang/miniconda3/envs/salient/lib/python3.8/site-packages/xesmf/frontend.py", line 397, in __call__
return self.regrid_dataset(indata, keep_attrs=keep_attrs)
File "/home/slevang/miniconda3/envs/salient/lib/python3.8/site-packages/xesmf/frontend.py", line 515, in regrid_dataset
ds_out = xr.apply_ufunc(
File "/home/slevang/miniconda3/envs/salient/lib/python3.8/site-packages/xarray/core/computation.py", line 1092, in apply_ufunc
return apply_dataset_vfunc(
File "/home/slevang/miniconda3/envs/salient/lib/python3.8/site-packages/xarray/core/computation.py", line 410, in apply_dataset_vfunc
result_vars = apply_dict_of_variables_vfunc(
File "/home/slevang/miniconda3/envs/salient/lib/python3.8/site-packages/xarray/core/computation.py", line 356, in apply_dict_of_variables_vfunc
result_vars[name] = func(*variable_args)
File "/home/slevang/miniconda3/envs/salient/lib/python3.8/site-packages/xarray/core/computation.py", line 653, in apply_variable_ufunc
raise ValueError(
ValueError: dimension 'dim1' in 'output_sizes' must correspond to output_core_dims
Regridding the tutorial dataset with single field air
works fine, but adding a second variable raises this error with dimension names.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kmuehlbauer probably knows whats going wrong.
cc @chiaral