Units module

PyFields.utils.units.make_unit(string)[source]

Create an Unum unit from a string. For more details, see the Unum module documentation.

Parameters:string (string) – String representing some units (e.g. ‘kg.m^-2.s^-1’, or ‘kg/m^2/s’).
Returns:unit – unum object representing the given units.
Return type:unum.Unum object

Examples

>>> make_unit("m/s")
1 [m/s]
>>> make_unit("N/m/s**3")
1 [kg/s4]