roseau.load_flow.units

Units registry used by Roseau Load Flow using the pint package.

class ureg

The pint.UnitRegistry object to use in this project. You should not need to use it directly.

class Q_

The pint.Quantity class to use in this project. You can use it to provide quantities in units different from the default ones. For example, to create a constant power load of 1 MVA, you can do:

>>> load = rlf.PowerLoad("load", bus=bus, powers=Q_([1, 1, 1], "MVA"))

which is equivalent to:

>>> load = rlf.PowerLoad("load", bus=bus, powers=[1000000, 1000000, 1000000])  # in VA

Functions

ureg_wraps(→ collections.abc.Callable[[FuncT], FuncT])

Wraps a function to become pint-aware.

Module Contents

ureg_wraps(ret: str | Unit | None | Iterable[str | Unit | None], args: str | Unit | None | Iterable[str | Unit | None], strict: bool = True) Callable[[FuncT], FuncT]

Wraps a function to become pint-aware.

Parameters:
  • ret – Units of each of the return values. Use None to skip argument conversion.

  • args – Units of each of the input arguments. Use None to skip argument conversion.

  • strict – Indicates that only quantities are accepted. (Default value = True)