Unit systems#
- class ansys.units.systems.UnitSystem(base_units: Mapping[BaseDimensions, Literal['kg', 'g', 'lb', 'lbm', 'slug', 'm', 'cm', 'ft', 'inch', 'in', 's', 'A', 'mol', 'slugmol', 'cd', 'sr', 'radian', 'degree', 'K', 'C', 'F', 'R', 'delta_K', 'delta_C', 'delta_F', 'delta_R', 'N', 'Pa', 'W', 'J', 'V', 'farad', 'H', 'S', 'Wb', 'T', 'dyne', 'erg', 'h', 'pdl', 'psi', 'lbf', 'psf', 'ohm', 'Hz', 'l', 'gal', 'BTU', 'cal', 'coulomb']] | None = None, system: Literal['SI', 'CGS', 'BT'] = 'SI', copy_from: UnitSystem | None = None)#
Bases:
objectA 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.
- system: str, Unit, optional
Predefined unit system.
- copy_from: UnitSystem, optional
Make a copy of a unit system.
- Attributes:
MASSMass unit of the unit system.
LENGTHLength unit of the unit system.
TIMETime unit of the unit system.
TEMPERATURETemperature unit of the unit system.
TEMPERATURE_DIFFERENCETemperature unit of the unit system.
ANGLEAngle unit of the unit system.
CHEMICAL_AMOUNTChemical Amount unit of the unit system.
LIGHTLight unit of the unit system.
CURRENTCurrent unit of the unit system.
SOLID_ANGLESolid Angle unit of the unit system.
- property TEMPERATURE_DIFFERENCE: Literal['delta_K', 'delta_C', 'delta_F', 'delta_R']#
Temperature unit of the unit system.
- update(base_units: Mapping[BaseDimensions, Literal['kg', 'g', 'lb', 'lbm', 'slug', 'm', 'cm', 'ft', 'inch', 'in', 's', 'A', 'mol', 'slugmol', 'cd', 'sr', 'radian', 'degree', 'K', 'C', 'F', 'R', 'delta_K', 'delta_C', 'delta_F', 'delta_R', 'N', 'Pa', 'W', 'J', 'V', 'farad', 'H', 'S', 'Wb', 'T', 'dyne', 'erg', 'h', 'pdl', 'psi', 'lbf', 'psf', 'ohm', 'Hz', 'l', 'gal', 'BTU', 'cal', 'coulomb']])#
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:
ValueErrorRaised when a unit is provided that does not have a valid type of base unit.
- exception ansys.units.systems.InvalidUnitSystem(sys)#
Bases:
ValueErrorRaised when a unit system is initialized with an unsupported unit system.
- exception ansys.units.systems.NotBaseUnit(unit)#
Bases:
ValueErrorRaised when a unit system unit is not a configured base unit.