-
Notifications
You must be signed in to change notification settings - Fork 413
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
add accessor convert to base units #2422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. @jthielen how do you feel about the spelling of this? It doesn't look like pint-xarray
has a corresponding method for us to match.
We can ignore Codacy here. I keep trying to get it to set the "issue" as ignored, but every analysis keeps flagging it. |
Yep, I noticed that as well, though I would suspect that if it ever did get added it would be consistent with the underlying Pint method of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me (pending decision on method name)!
Until there's actually something to be consistent with elsewhere, we shouldn't invent something that may be consistent with it. So given that the current naming fits with our existing API, that's what seems to be best for our users. |
Description Of Changes
This PR adds to the metpy xarray accessor to have a
convert_to_base_units()
function, which will allow for the simplification of complex units following calculations using quantify xarray DataArrays.Added a test and a simple example to the xarray tutorial.
Checklist
to_base_units
#2363