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

Still further updates to pint master branch compatibility #1261

Merged
merged 1 commit into from
Dec 30, 2019
Merged

Still further updates to pint master branch compatibility #1261

merged 1 commit into from
Dec 30, 2019

Conversation

jthielen
Copy link
Collaborator

@jthielen jthielen commented Dec 29, 2019

Description Of Changes

In what is becoming a recurring pattern (#1144, #1250), MetPy has conflicts with the current state of Pint's master branch! This PR

  • cleans up missing Nones for non-unit arguments with @units.wraps (without this, pytest will not run due to an ImportError)
  • fixes wet_bulb_temperature to not assume unit is stripped
  • sets PINT_ARRAY_PROTOCOL_FALLBACK environment variable to '0' to disable Pint's problematic __array_struct__ and __array_interface__ fallback (xref Proper handling of __array_*__ attributes/methods hgrecco/pint#924)
  • creates a dummy array Quantity within a warning filter context to bypass Pint's NEP 18 warning

This is likely needed ASAP, since Pint v0.10 is expected out soon

Checklist

  • Fully documented

@dopplershift dopplershift added this to the 0.12 milestone Dec 30, 2019
@dopplershift dopplershift added Area: Units Pertains to unit information Type: Maintenance Updates and clean ups (but not wrong) labels Dec 30, 2019
Copy link
Member

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the continued maintenance on this.

@@ -28,6 +29,7 @@

# Must occur before below imports
warnings.filterwarnings('ignore', 'numpy.dtype size changed')
os.environ['PINT_ARRAY_PROTOCOL_FALLBACK'] = '0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is here and not in units.py?

Copy link
Collaborator Author

@jthielen jthielen Dec 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is here, then we don't need the import order break and # noqa in units.py, but I can easily change it to that if it is preferred.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that's fine. Let's leave it.

@dopplershift dopplershift merged commit 1f41c47 into Unidata:master Dec 30, 2019
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: Maintenance Updates and clean ups (but not wrong)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants