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

FutureWarning in apply_ufunc #103

Merged
merged 3 commits into from
Aug 12, 2021
Merged

Conversation

slevang
Copy link
Contributor

@slevang slevang commented Jul 21, 2021

Since pydata/xarray#4060, xesmf has given a FutureWarning for supplying output_sizes directly in xr.apply_ufunc rather than through dask_gufunc_kwargs.

import xarray as xr
import xesmf as xe

ds = xr.tutorial.open_dataset('air_temperature')
regridder = xe.Regridder(ds, ds[['lon', 'lat']], 'bilinear')
regridder(ds)
xesmf/frontend.py:555: FutureWarning: ``output_sizes`` should be given in the ``dask_gufunc_kwargs`` parameter. It will be removed as direct parameter in a future version.
  ds_out = xr.apply_ufunc(

This eliminates the warning.

@raphaeldussin raphaeldussin requested a review from huard July 21, 2021 16:22
@raphaeldussin
Copy link
Contributor

@slevang thank you for this fix, it LGTM
@huard I'll let you merge it in

Copy link
Contributor

@huard huard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back from vacations.
Do we need stricter limits on supported xarray versions with this ?

@slevang
Copy link
Contributor Author

slevang commented Aug 12, 2021

You're right, looks like this kwarg was added to xarray in 0.16.1 (pydata/xarray#4060), which had other issues as well and needed to be avoided. So we need xarray>=0.16.2 I believe.

@huard huard merged commit 6cad2ee into pangeo-data:master Aug 12, 2021
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

Successfully merging this pull request may close these issues.

3 participants