IrreducibleUnit

class astropy.units.core.IrreducibleUnit(st, register=False, doc=None, format=None) [edit on github][source]

Bases: astropy.units.core.NamedUnit

Irreducible 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

bases Return the bases of the unit.
powers Return the powers of the unit.
scale Return the scale of the unit.

Methods Summary

decompose([bases]) Return a unit object composed of only irreducible units.

Attributes Documentation

bases[source]

Return the bases of the unit.

powers[source]

Return the powers of the unit.

scale[source]

Return the scale of the unit.

Methods Documentation

decompose(bases=set([])) [edit on github][source]

Return a unit object composed of only irreducible units.

Parameters :

bases : sequence 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 UnitsException if it’s not possible to do so.

Returns :

unit : CompositeUnit object

New object containing only irreducible unit objects.

Page Contents