You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a series of tests that have been passing since we started using Pint to handle units in our software (we adopted it in 2016). We recently updated to Pint 0.23 and these test are failing now, though (strangely) not in all similar cases.
We've defined some custom pressure units to handle gauge pressure (measurements using atmospheric pressure as its zero point). We want to (and have been able to historically) convert between absolute pressure and gauge pressure. Because of changes in 0.23 this no longer works.
We've defined our extra pressure units in our units.txt file as such:
pint.errors.DimensionalityError: Cannot convert from 'standard_atmosphere' ([mass] / [length] / [time] ** 2) to '1 / second ** 2' (1 / [time] ** 2)
The reason why it fails for some gauge units but not for all, is caused by the differences in the definition. The code used only the last unit in the UnitsContainer of the "to"-unit. This works fine as long as the gauge unit is defined based on a single unit ("pascal"). However, if you use a composed unit "gram / metre / second ** 2" the code picked only the last element in the UnitContainer which is '1 / second ** 2'.
Hi There,
I have a series of tests that have been passing since we started using Pint to handle units in our software (we adopted it in 2016). We recently updated to Pint 0.23 and these test are failing now, though (strangely) not in all similar cases.
We've defined some custom pressure units to handle gauge pressure (measurements using atmospheric pressure as its zero point). We want to (and have been able to historically) convert between absolute pressure and gauge pressure. Because of changes in 0.23 this no longer works.
We've defined our extra pressure units in our units.txt file as such:
In version 0.22 I was able to do the following, but no longer can:
I get a DimensionalityError when I try this
Interestingly though, I don't have that problem with
Pa_gauge
bar_gauge
orpsig
. Only withinHg_gauge
andtorr_gauge
.Is this a bug, or is there something I should do to my unit definitions to accommodate changes in how pint handles things?
Thanks for your help!
The text was updated successfully, but these errors were encountered: