polymerist.unitutils.unitstr

Utilities for looking up and producing Units from strings

Attributes

UNITS_BY_SYMBOL

UNITS_BY_NAME

attr_val

Functions

unit_from_unit_str(→ Optional[openmm.unit.Unit])

Take a string describing units, with units and exponents delimited consistently (ex: "kg m^2 s^-2")

Module Contents

polymerist.unitutils.unitstr.UNITS_BY_SYMBOL: dict[str, openmm.unit.Unit]
polymerist.unitutils.unitstr.UNITS_BY_NAME: dict[str, openmm.unit.Unit]
polymerist.unitutils.unitstr.attr_val
polymerist.unitutils.unitstr.unit_from_unit_str(unit_str: str, unit_delimiter: str = ' ', exp_delimiter: str = '^') openmm.unit.Unit | None[source]

Take a string describing units, with units and exponents delimited consistently (ex: “kg m^2 s^-2”) and convert it into a proper OpenMM Unit if possible, returning None if not