QuantityPoint
- class QuantityPoint
Description
A concrete quantity point 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.
Note that as a space optimization, the origin is stored as a numerical value with the same units as the displacement.
Inheritance:
Members defined in
QuantityPoint(14 members)RThe numerical value of this quantity point in base units relative to natural origin.
RGet the free quantity relative to the natural origin of the quantity.
RThe numerical value of this quantity in base units.
RGet the free quantity relative to the origin of this point.
RWThe numerical value of this quantity.
RThe origin of this point.
RThe measurement units of this quantity.
RThe numerical value of zero offset in units of this point.
Construct a strong quantity with numerical value and a unit.
Get a displacement relative to another
origin.Convert this to different measurement
unit.Convert this to different measurement
unit.Attributes
- property absolute_base_repr: float
The numerical value of this quantity point in base units relative to natural origin.
- property absolute_displacement: syside.experimental.units.Quantity
Get the free quantity relative to the natural origin of the quantity.
- property displacement: syside.experimental.units.QuantityDelta
Get the free quantity relative to the origin of this point.
- property point_origin: syside.experimental.units.PointOrigin
The origin of this point.
Note that this will return point origin in the point units as actual reference is not stored as an optimization.
- 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.
- __init__(arg: syside.experimental.units.Quantity, /) None
Explicitly convert an absolute quantity to a point relative to the natural origin.
- __init__(arg0: syside.experimental.units.QuantityDelta, arg1: syside.experimental.units.PointOrigin, /) None
Construct a point with a displacement relative to some origin.
Raises
ValueErrorif origin is an incompatible quantity with the displacement.
- displacement_from(arg: syside.experimental.units.PointOrigin, /) syside.experimental.units.QuantityDelta
Get a displacement relative to another
origin.Raises
ValueErroriforiginquantity is incompatible with this point.
- to(arg: syside.experimental.units.Unit, /) syside.experimental.units.QuantityPoint
Convert this to different measurement
unit.Raises
ValueErrorifself.unitis not convertible tounit.
- try_to(arg: syside.experimental.units.Unit, /) syside.experimental.units.QuantityPoint | None
Convert this to different measurement
unit.Returns
Noneifself.unitis not convertible tounit.