BioSTEAMDevelopmentGroup / thermosteam

BioSTEAM's Premier Thermodynamic Engine
Other
57 stars 12 forks source link

Use pint.get_application_registry() rather than creating one with UnitRegistry() #91

Closed rjplevin closed 1 year ago

rjplevin commented 1 year ago

My app is unable to compare pint Quantities because they are based on different registries.

I believe thermosteam is not following the latest guidance (that I found) in pint on avoiding multiple unit registries, which is for libraries to call pint.get_application_registry(), allowing the app to establish a registry used by all libraries, ensuring that Quantities are commensurable.

Instead, thermosteam creates its own by calling ureg = UnitRegistry().

yoelcortes commented 1 year ago

@rjplevin, thanks for posting the issue. It should be fixed now. It also seems like pint has also made many enhancements and added new units like bushels (which I had to add before).

Thanks!