A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.astropy.org/en/stable/api/../api/astropy.units.Unit.html below:

Unit β€” Astropy v7.1.0

Unit#
class astropy.units.Unit(s='', represents=None, format=None, namespace=None, doc=None, parse_strict='raise')[source]#

Bases: NamedUnit

The main unit class.

There are a number of different ways to construct a Unit, but always returns a UnitBase instance. If the arguments refer to an already-existing unit, that existing unit instance is returned, rather than a new one.

See also: https://docs.astropy.org/en/stable/units/

Parameters:
ststr or list of str

The name of the unit. If a list, the first element is the canonical (short) name, and the rest of the elements are aliases.

representsastropy:unit-like, optional

The unit that this named unit represents.

docstr, optional

A docstring describing the unit.

formatdict, optional

A mapping to format-specific representations of this unit. For example, for the Ohm unit, it might be nice to have it displayed as \Omega by the latex formatter. In that case, format argument should be set to:

namespacedict, optional

When provided, inject the unit (and all of its aliases) into the given namespace.

Raises:
ValueError

If any of the given unit names are already in the registry.

ValueError

If any of the given unit names are not valid Python tokens.

ValueError

If represents cannot be parsed as a unit, e.g., because it is a malformed string or a Quantity that is not a scalar.

Attributes Summary

Methods Summary

Attributes Documentation

represents#

The unit that this named unit represents.

Methods Documentation

decompose(bases: Collection[UnitBase] = ()) β†’ UnitBase[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 UnitsError if it’s not possible to do so.

Returns:
unitCompositeUnit

New object containing only irreducible unit objects.

is_unity() β†’ bool[source]#

Check whether the unit is unscaled and dimensionless.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4