Units and unit systems#

Unit system for physical quantities; include definition of constants.

class sympy.physics.units.unitsystem.UnitSystem(base_units, units=(), name='', descr='', dimension_system=None, derived_units: Dict[sympy.physics.units.dimensions.Dimension, sympy.physics.units.quantities.Quantity] = {})[source]#

UnitSystem represents a coherent set of units.

A unit system is basically a dimension system with notions of scales. Many of the methods are defined in the same way.

It is much better if all base units have a symbol.

property dim#

Give the dimension of the system.

That is return the number of units forming the basis.

extend(base, units=(), name='', description='', dimension_system=None, derived_units: Dict[sympy.physics.units.dimensions.Dimension, sympy.physics.units.quantities.Quantity] = {})[source]#

Extend the current system into a new one.

Take the base and normal units of the current system to merge them to the base and normal units given in argument. If not provided, name and description are overridden by empty strings.

get_units_non_prefixed() Set[sympy.physics.units.quantities.Quantity][source]#

Return the units of the system that do not have a prefix.

property is_consistent#

Check if the underlying dimension system is consistent.