QuantityDelta

Labs

class QuantityDelta

Description

A concrete quantity delta value.

Format specification is :[float spec][:[p|f|B][b]], where

  • p adds the nearest engineering SI prefix (e.g. excluding centi) if the unit is prefixable.

  • f adds the nearest full SI prefix (e.g. including centi) if the unit is prefixable.

  • B adds 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.

  • b prints the quantity value in its base units.

Inheritance:

Members defined in QuantityDelta (9 members)

base_repr

R

The numerical value of this quantity in base units.

numerical

RW

The numerical value of this quantity.

unit

R

The measurement units of this quantity.

__init__

Construct a strong quantity with numerical value and a unit.

__repr__

__str__

absolute

Convert a delta value to an absolute value relative to the natural origin.

to

Convert this to different measurement unit.

try_to

Convert this to different measurement unit.

Attributes

property base_repr: float

The numerical value of this quantity in base units.

property numerical: float

The numerical value of this quantity.

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 delta relative to the natural origin.

__repr__() → str
__str__() → str
absolute() → syside.experimental.units.Quantity

Convert a delta value to an absolute value relative to the natural origin.

to(arg: syside.experimental.units.Unit, /) → syside.experimental.units.QuantityDelta

Convert this to different measurement unit.

Raises ValueError if self.unit is not convertible to unit.

try_to(arg: syside.experimental.units.Unit, /) → syside.experimental.units.QuantityDelta | None

Convert this to different measurement unit.

Returns None if self.unit is not convertible to unit.