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

Compare units from different registry that are similar #445

Closed
nowox opened this issue Oct 9, 2016 · 2 comments
Closed

Compare units from different registry that are similar #445

nowox opened this issue Oct 9, 2016 · 2 comments

Comments

@nowox
Copy link
Contributor

nowox commented Oct 9, 2016

I would like to use Pint to work with quantities of different devices. These devices can have the same or different definitions of units. If they are the same, I would like to allow these registry to work together.

My current workaround is to have a master registry singleton that takes a registry and return an unified registry. The master class knows the used registry and if the input registry is similar another one already in the known registry list, the registry from the database is returned.

a = pint.UnitRegistry()
b = pint.UnitRegistry()
c = Registry(a)
d = Registry(b)
e = c.meters * d.meters

I don't like this workaround. Is there any better solution?

@hgrecco
Copy link
Owner

hgrecco commented Nov 17, 2016

The suggestion is http://pint.readthedocs.io/en/0.7.2/tutorial.html#using-pint-in-your-projects

Will that work for you?

@hgrecco
Copy link
Owner

hgrecco commented Dec 3, 2019

Closing. Feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants