pyunitwizard.get_value_and_unit#

pyunitwizard.get_value_and_unit(quantity, to_unit=None, to_form=None, parser=None, standardized=False)[source]#

Returns the value and unit of a quantity.

Parameters:
  • to_unit (str, optional) – Name of the unit to which the quantity will be converted (i.e kcal/mol).

  • parser ({"unyt", "pint", "openmm.unit", "astropy.units"}, optional) – The parser to use.

  • quantity (QuantityLike)

  • to_form (str | None)

  • standardized (bool | None)

Returns:

  • np.ndarray or float or int

  • UnitLike – The value and unit of the input quantity.

Return type:

Tuple[ndarray | float | int, UnitLike]