Quantity
- class Quantity
Description
A concrete absolute quantity value.
Format specification is
:[float spec][:[p|f|B][b]], wherepadds the nearest engineering SI prefix (e.g. excludingcenti) if the unit is prefixable.fadds the nearest full SI prefix (e.g. includingcenti) if the unit is prefixable.Badds the nearest binary IEC prefix if the unit is prefixable, this should typically be used with bit related quantities. Note the uppercase letter that matches casing on binary prefixes.bprints the quantity value in its base units.
Inheritance:
Members defined in
Quantity(9 members)RThe numerical value of this quantity in base units.
RWThe numerical value of this quantity.
RThe measurement units of this quantity.
Construct a strong quantity with numerical value and a unit.
Convert an absolute value to a delta value relative to the natural origin.
Convert this to different measurement
unit.Convert this to different measurement
unit.Attributes
- property unit: syside.experimental.units.Unit
The measurement units of this quantity.
Methods
- __init__(arg0: float, arg1: syside.experimental.units.Unit, /) None
Construct a strong quantity with numerical value and a unit.
- __init__(arg: syside.experimental.units.Unit, /) None
Construct a unit quantity, i.e.
numerical() == 1.
- delta() syside.experimental.units.QuantityDelta
Convert an absolute value to a delta value relative to the natural origin.
- to(arg: syside.experimental.units.Unit, /) syside.experimental.units.Quantity
Convert this to different measurement
unit.Raises
ValueErrorifself.unitis not convertible tounit.
- try_to(arg: syside.experimental.units.Unit, /) syside.experimental.units.Quantity | None
Convert this to different measurement
unit.Returns
Noneifself.unitis not convertible tounit.