pyunitwizard.get_value_and_unit#
- pyunitwizard.get_value_and_unit(quantity, to_unit=None, to_form=None, parser=None, standardized=False, value_type=None, dtype=None)[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 (Any)
to_form (str | None)
standardized (bool | None)
value_type (Any | None)
dtype (Any | None)
- Returns:
np.ndarray or float or int
UnitLike – The value and unit of the input quantity.
- Return type:
Tuple[ndarray | float | int | list | tuple, Any]