from_openmm

openff.units.openmm.from_openmm(openmm_quantity: openmm_unit.Quantity) Quantity[source]

Convert an OpenMM Quantity to an OpenFF Quantity

openmm.unit.quantity.Quantity from OpenMM and openff.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)