Unit systems#

class ansys.units.systems.UnitSystem(base_units: dict[BaseDimensions, any] | None = None, system: str | None = None, copy_from: UnitSystem | None = None)#

Bases: object

A class representing base units for a unit system.

Predefined unit systems work automatically and are configured when the package is initialized, whereas you can add user-defined systems at any time.

Parameters:
base_units: dict, optional

Units mapped to base dimensions types.

unit_sys: str, Unit, optional

Predefined unit system.

copy_from: UnitSystem, optional

Make a copy of a unit system.

Attributes:
MASS

Mass unit of the unit system.

LENGTH

Length unit of the unit system.

TIME

Time unit of the unit system.

TEMPERATURE

Temperature unit of the unit system.

TEMPERATURE_DIFFERENCE

Temperature unit of the unit system.

ANGLE

Angle unit of the unit system.

CHEMICAL_AMOUNT

Chemical Amount unit of the unit system.

LIGHT

Light unit of the unit system.

CURRENT

Current unit of the unit system.

SOLID_ANGLE

Solid Angle unit of the unit system.

property ANGLE#

Angle unit of the unit system.

property CHEMICAL_AMOUNT#

Chemical Amount unit of the unit system.

property CURRENT#

Current unit of the unit system.

property LENGTH#

Length unit of the unit system.

property LIGHT#

Light unit of the unit system.

property MASS#

Mass unit of the unit system.

property SOLID_ANGLE#

Solid Angle unit of the unit system.

property TEMPERATURE#

Temperature unit of the unit system.

property TEMPERATURE_DIFFERENCE#

Temperature unit of the unit system.

property TIME#

Time unit of the unit system.

update(base_units: dict[slice(<enum 'BaseDimensions'>, <built-in function any>, None)])#

Change the units of the unit system.

Parameters:
base_units: dict

Units mapped to base dimensions types.

exception ansys.units.systems.IncorrectUnitType(unit, unit_type)#

Bases: ValueError

Raised when a unit is provided that does not have a valid type of base unit.

exception ansys.units.systems.InvalidUnitSystem(sys)#

Bases: ValueError

Raised when a unit system is initialized with an unsupported unit system.

exception ansys.units.systems.NotBaseUnit(unit)#

Bases: ValueError

Raised when a unit system unit is not a configured base unit.