Defines a physical quantity.
More...
Defines a physical quantity.
- Parameters
-
unitdict | dict A dictionary containing the physical unit and the scale factor to a reference unit |
iunit | str The default input unit if not unit is given |
ounit | str The output unit |
◆ __init__()
def carputils.carpio.quantity.PhysicalQuantity.__init__ |
( |
|
self, |
|
|
|
unitdict, |
|
|
|
iunit, |
|
|
|
ounit |
|
) |
| |
◆ __call__()
def carputils.carpio.quantity.PhysicalQuantity.__call__ |
( |
|
self, |
|
|
|
valuestr |
|
) |
| |
◆ from_string()
def carputils.carpio.quantity.PhysicalQuantity.from_string |
( |
|
self, |
|
|
|
valuestr, |
|
|
|
ounit = None |
|
) |
| |
Convert a str to numerical value.
- Parameters
-
valuestr | str A string representing the physical quantity |
ounit | str, optional The desired output unit, if None the default output unit is used |
◆ input_unit
carputils.carpio.quantity.PhysicalQuantity.input_unit = property |
|
static |
Get the default input unit.
◆ output_unit
carputils.carpio.quantity.PhysicalQuantity.output_unit = property |
|
static |
◆ units
carputils.carpio.quantity.PhysicalQuantity.units = property |
|
static |
Get all the supported units.
The documentation for this class was generated from the following file: