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

Regridding weights not properly reused #411

Closed
bstdenis opened this issue May 30, 2024 · 0 comments · Fixed by #414
Closed

Regridding weights not properly reused #411

bstdenis opened this issue May 30, 2024 · 0 comments · Fixed by #414

Comments

@bstdenis
Copy link
Collaborator

It seems like the regridding weights in regrid_dataset are not reused as expected from the weights_location keyword.

The kwargs set at

kwargs["weights"] = weights_filename

are not passed to xe.Regridder? They should be assigned to regridder_kwargs instead of kwargs

ds_in=ds, ds_grid=ds_grid, filename=weights_filename, **regridder_kwargs

Some benchmarks with the original code:
Initial regrid dataset in fn test_xarray_regrid took 18.9291 seconds
Second regrid dataset in fn test_xarray_regrid took 13.4746 seconds

And by assigning 'weights' and 'reuse_weights' to regridder_kwargs
Initial regrid dataset in fn test_xarray_regrid took 16.8666 seconds
Second regrid dataset in fn test_xarray_regrid took 4.2991 seconds

Fixed in f12895a

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 a pull request may close this issue.

1 participant