Skip to content

Commit ffcb990

Browse files
Unit registry preprocessor to attempt to fix percent unit issue in python3.8
1 parent 7c008fa commit ffcb990

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/geophires_x/Units.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def get_unit_registry():
1111
if _UREG is None:
1212
_UREG = pint.get_application_registry()
1313
_UREG.load_definitions(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'GEOPHIRES3_newunits.txt'))
14+
_UREG.preprocessors.append(lambda s: s.replace('%', 'percent'))
1415

1516
return _UREG
1617

0 commit comments

Comments
 (0)