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

Prepare for __array_function__ implementation in pint #1111

Closed
jthielen opened this issue Jul 25, 2019 · 1 comment · Fixed by #1144
Closed

Prepare for __array_function__ implementation in pint #1111

jthielen opened this issue Jul 25, 2019 · 1 comment · Fixed by #1144
Labels
Area: Units Pertains to unit information Type: Bug Something is not working like it should
Milestone

Comments

@jthielen
Copy link
Collaborator

Pint is getting close to implementing the __array_function__ protocol (hgrecco/pint#764), which will allow many more numpy functions to work with and return pint Quantitys. However, this breaks many functions in MetPy that currently reattach units after assuming that units get stripped by the numpy functions. Would the best way forward be to

  • Explicitly strip and reattach units in MetPy (by calling Quantity.magnitude or np.asarray(Quantity)) to maintain backwards compatibility?
  • Bump minimum pint version to the release when __array_function__ is implemented and remove the strip-and-reattach workarounds?

(Also, just since it popped up in related issue suggestions, would this resolve what is left of #38?)

@dopplershift dopplershift added this to the 0.11 milestone Jul 26, 2019
@dopplershift dopplershift added Area: Units Pertains to unit information Type: Bug Something is not working like it should labels Jul 26, 2019
@dopplershift
Copy link
Member

Good point. Really import to be proactive here so we don't have a release broken by this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Units Pertains to unit information Type: Bug Something is not working like it should
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants