IrreducibleUnit#
- class astropy.units.IrreducibleUnit(st, doc=None, format=None, namespace=None)[source]#
Bases:
NamedUnitIrreducible units are the units that all other units are defined in terms of.
Examples are meters, seconds, kilograms, amperes, etc. There is only once instance of such a unit per type.
Attributes Summary
The unit that this named unit represents.
Methods Summary
decompose([bases])Return a unit object composed of only irreducible units.
Attributes Documentation
- represents#
The unit that this named unit represents.
For an irreducible unit, that is always itself.
Methods Documentation
- decompose(bases={})[source]#
Return a unit object composed of only irreducible units.
- Parameters:
- basessequence of
UnitBase, optional The bases to decompose into. When not provided, decomposes down to any irreducible units. When provided, the decomposed result will only contain the given units. This will raises a
UnitsErrorif it’s not possible to do so.
- basessequence of
- Returns:
- unit
CompositeUnit New object containing only irreducible unit objects.
- unit