Skip to content

Commit 2456f3c

Browse files
committed
use pint.get_application_registry() to handle downstream unit registries
1 parent ec21f83 commit 2456f3c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pymie/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@
3333
"""
3434

3535
import numpy as np
36-
from pint import UnitRegistry
36+
import pint
3737

38-
# Load the default unit registry from pint and use it everywhere.
39-
# Using the unit registry (and wrapping all functions) ensures that we don't
40-
# make unit mistakes
41-
ureg = UnitRegistry()
38+
# Load either the default unit registry or the registry that has been set by
39+
# packages that use pymie
40+
ureg = pint.get_application_registry()
4241
Quantity = ureg.Quantity
4342

4443
@ureg.check('[length]', None)

0 commit comments

Comments
 (0)