Skip to content

Commit

Permalink
Unit registry preprocessor to attempt to fix percent unit issue in py…
Browse files Browse the repository at this point in the history
…thon3.8
  • Loading branch information
softwareengineerprogrammer committed Oct 11, 2024
1 parent 7c008fa commit ffcb990
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/geophires_x/Units.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def get_unit_registry():
if _UREG is None:
_UREG = pint.get_application_registry()
_UREG.load_definitions(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'GEOPHIRES3_newunits.txt'))
_UREG.preprocessors.append(lambda s: s.replace('%', 'percent'))

return _UREG

Expand Down

0 comments on commit ffcb990

Please sign in to comment.