- qunits.Unit ( scale = 1.0 , dimension = "Dimensionless" , context = "" , symbol = None , prefix_exp = None )[source]
The base class for units. Creating a new unit with the same
dimensionandscaleof an existing unit will return the cached instance. Thesymbolandprefix_expattributes are only used for string representation and are set to the first created unit.- Parameters:
-
- scalescalar
The scale by which the unit is multiplied (e.g.,
1.0for Tesla,1e-4for Gauss).- dimensiontype[qunits.dimension.Dimension]
The dimension of the unit (e.g.,
Length,Mass,Time).- contextstr
The context of the unit (e.g.,
"","angle","solid-angle").- symbolstr | None
The symbol of the unit (e.g.,
"m"for meter,"s"for second).- prefix_expint | None
The exponent of the prefix (e.g.,
-3for milli,3for kilo).