Skip to content

Commit

Permalink
Update scripts/parse_tools/parse_checkers.py to allow for underscores…
Browse files Browse the repository at this point in the history
… in unit metadata attribues
  • Loading branch information
climbfuji committed Mar 8, 2024
1 parent 4d8a4d9 commit 6cdd38a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/parse_tools/parse_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

_UNITLESS_REGEX = "1"
_NON_LEADING_ZERO_NUM = "[1-9]\d*"
_CHAR_WITH_UNDERSCORE = "([a-zA-Z]+_[a-zA-Z]+)+"
_NEGATIVE_NON_LEADING_ZERO_NUM = f"[-]{_NON_LEADING_ZERO_NUM}"
_UNIT_EXPONENT = f"({_NEGATIVE_NON_LEADING_ZERO_NUM}|{_NON_LEADING_ZERO_NUM})"
_UNIT_REGEX = f"[a-zA-Z]+{_UNIT_EXPONENT}?"
_UNITS_REGEX = f"^({_UNIT_REGEX}(\s{_UNIT_REGEX})*|{_UNITLESS_REGEX})$"
_UNITS_REGEX = f"^({_CHAR_WITH_UNDERSCORE}|{_UNIT_REGEX}(\s{_UNIT_REGEX})*|{_UNITLESS_REGEX})$"
_UNITS_RE = re.compile(_UNITS_REGEX)
_MAX_MOLAR_MASS = 10000.0

Expand Down

0 comments on commit 6cdd38a

Please sign in to comment.