Dimensions#

class ansys.units.dimensions.Dimensions(dimensions: dict[BaseDimensions, int | float] | None = None, copy_from: Dimensions | None = None)#

Bases: object

A representation of an arbitrary number of dimensions, where each dimension is a pair consisting of a base dimension and exponent.

A dictionary of BaseDimensions and exponent is required for a non-dimensionless object.

If any keys are duplicated in copy_from and dimensions then the associated values from dimensions are used.

Parameters:
dimensionsdict, optional

Dictionary of {BaseDimensions: exponent, …}.

systemUnitSystem, optional

The unit system for the dimensions.

copy_fromDimensions, optional

A previous instance of Dimensions.

exception ansys.units.dimensions.IncorrectDimensions#

Bases: ValueError

Raised on initialization if a dimension is not of type BaseDimensions.