from_openmm
- openff.units.openmm.from_openmm(openmm_quantity: openmm.unit.Quantity) Quantity [source]
Convert an OpenMM
Quantity
to an OpenFFQuantity
openmm.unit.quantity.Quantity
from OpenMM andopenff.units.Quantity
from this package both represent a numerical value with units.Examples
>>> from openff.units import Quantity as OpenFFQuantity >>> from openff.units.openmm import from_openmm >>> from openmm import unit >>> length = unit.Quantity(9.0, unit.angstrom) >>> from_openmm(length) <Quantity(9.0, 'angstrom')> >>> assert isinstance(from_openmm(length), OpenFFQuantity)