energia.components.measure.unit

Contents

energia.components.measure.unit#

Unit

Functions

is_(a, b, /)

Same as a is b.

Classes

Unit([basis, times, label])

Unit of measure for a quantity provided as input to a component

class Unit(basis: Self | None = None, times: int | float | None = None, label: str = '')[source]#

Bases: _Name

Unit of measure for a quantity provided as input to a component

Parameters:
  • label (str, optional) – Label of the component, used for plotting. Defaults to None.

  • basis (Unit, optional) – Basis of the unit, if defined based on another Unit. Defaults to None.

  • times (int | float, optional) – How many times the basis is contained in the unit. Defaults to None.

Variables:

name (str) – Name of the object. Defaults to ‘’.

howmany(basis: Self)[source]#

How many times is this basis contained in the other basis

Parameters:

basis (Unit) – Basis to compare with.