edges.units

Functions for dealing with units and quantities.

edges.units.is_unit(unit: str) bool[source]

Whether the given input is a recognized unit.

edges.units.unit_convert_or_apply(x: float | Quantity, unit: str | Unit, in_place: bool = False, warn: bool = False) Quantity[source]

Safely convert a given value to a quantity.

edges.units.unit_converter(unit: str | Unit) Callable[[float | Quantity], Quantity][source]

Return a function that will convert values to a given quantity.

edges.units.vld_unit(unit: str | Unit, equivalencies=()) Callable[[Any, Attribute, Any], None][source]

Attr validator to check physical type.