pyunitwizard.get_unit#

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

Returns the unit of a quantity.

Parameters:
  • to_unit (str, optional) –

    Name of the unit to which the quantity will be converted (i.e kcal/mol).

    form{“unyt”, “pint”, “openmm.unit”, “astropy.units”, “string”}, optional

    If passed the unit will be converted to that form. This is the type that will be returned

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

  • quantity (QuantityLike)

  • to_form (str | None)

  • standardized (bool | None)

Returns:

The unit.

Return type:

UnitLike