-
Notifications
You must be signed in to change notification settings - Fork 10
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
update converters for pint 0.22 #880
Conversation
in 0.22 Quantity appears at pint.registry.Quantity and requires an update to the corresponding asdf Converter (the same for pint.registry.Unit).
Codecov Report
@@ Coverage Diff @@
## master #880 +/- ##
==========================================
- Coverage 96.48% 96.47% -0.02%
==========================================
Files 95 95
Lines 6293 6293
==========================================
- Hits 6072 6071 -1
- Misses 221 222 +1
|
thank you for the thorough explanation and solution with listing it is unfortunate that I am waiting for the conda release of |
Thanks! |
in pint 0.22 Quantity appears at pint.registry.Quantity and requires an update to the corresponding asdf
Converter (the same for pint.registry.Unit).
Changes
I opted to add the type
pint.Quantity
to the types supported byPintQuantityConverter
. Types and/or strings can be used here and both have pros/cons. Using the type requires that pint be imported when theConverter
is created (which can slow down initialization while asdf loads extensions. However this doesn't appear to be an issue here as pint is already imported whenweldx.tags.units.pint_quantity
is imported. By using the type, pint is free to move the internal implementation of Quantity (which can change the class path) but as long as it appears importable viapint.Quanity
the Converter should stay up-to-date.In this case the string
"pint.Quantity"
also needs to be included asweldx.constants.Q_
appears as a"pint.Quantity"
when asdf inspects instances ofweldx.constants.Q_
(as inspected withasdf.util.get_class_name
).I added some comments with a shorter version of the above description.
Related Issues
Fixes #879
Checks
CHANGELOG.md
tests/
doc/