pint icon indicating copy to clipboard operation
pint copied to clipboard

get_application_registry/set_application_registry broke in 0.18

Open cslominski opened this issue 1 year ago • 2 comments

Hi,

The follow code succeeds in 0.17 but fails in 0.18:

import pint ur = pint.UnitRegistry() pint.set_application_registry(ur) assert ur is pint.get_application_registry()

This appears to be a serious issue. Could you please help?

Thanks, Charlie

cslominski avatar Aug 13 '22 17:08 cslominski

this is a side-effect of making the application registry a instance of ApplicationRegistry, which solves a lot of inter-library compatibility issues.

This still holds:

assert ur is pint.get_application_registry().get()

keewis avatar Aug 13 '22 18:08 keewis

This fix worked for me, thank you so much. Is there a way I could have determined that from the documentation?

cslominski avatar Aug 13 '22 18:08 cslominski