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

Fix xarray .drop() deprecation #54

Merged
merged 4 commits into from
Sep 29, 2022
Merged

Fix xarray .drop() deprecation #54

merged 4 commits into from
Sep 29, 2022

Conversation

brews
Copy link
Member

@brews brews commented Sep 28, 2022

xarray is deprecating .drop() so we're getting warnings about it. This fixes the problem by changing it for the recommended .drop_vars().

This also adds a test covering the behavior where this swap needs to occur. Not the greatest test but just in case.

Close #37

This adds a test covering the behavior where we need to swap out the deprecated method. Just in case.
@brews brews added the bug Something isn't working label Sep 28, 2022
@brews brews self-assigned this Sep 28, 2022
@brews brews changed the title Draft: Swap deprecated .drop() for .drop_dims() Draft: Fix xarray .drop() deprecation Sep 28, 2022
@brews
Copy link
Member Author

brews commented Sep 28, 2022

CI tests are failing I'm missing something obvious here.

Edit: Fixed.

The key here is that the variables needs to be dropped, not the
dimension. I'm not sure whether or not this is intended but it
makes current behavior consistent with the past.
@brews brews changed the title Draft: Fix xarray .drop() deprecation Fix xarray .drop() deprecation Sep 28, 2022
@brews brews merged commit f784eae into main Sep 29, 2022
@brews brews deleted the fix_xarray_deprecation branch September 29, 2022 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace deprecated xarray method .drop with .drop_sel in simple_storage
2 participants