qunits logo qunits logo

A performant, verbose and generic physical unit system.

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qunits.dimension. Dimension[source]

The base class of the dimensions. A dimension is a vector of the exponents of the seven SI base dimensions. The dimensions are classes, not instances, and there is exactly one class per vector. Dimensions that are not predefined are created by unit arithmetic, e.g. (u.cd / u.m**2).d.

Attributes:
namestr

The name of the dimension. Dimensions created by unit arithmetic have generated names, e.g. LuminousIntensity__DIV__Area.

si_mapExpMap

The ExpMap of the SI unit of the dimension, e.g. frozenset({("J", 1)}) for Energy.

vecDimensionVec

The DimensionVec of the dimension, e.g. (0, 1, 0, 0, 0, 0, 0) for Length.