Skip to content

Fix xarray .drop() deprecation#54

Merged
brews merged 4 commits intomainfrom
fix_xarray_deprecation
Sep 29, 2022
Merged

Fix xarray .drop() deprecation#54
brews merged 4 commits intomainfrom
fix_xarray_deprecation

Conversation

@brews
Copy link
Copy Markdown
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
Copy Markdown
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 requested a review from kemccusker September 28, 2022 22:49
@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