spectrochempy.Quantity

class Quantity(value, units=None)[source]

Methods

Quantity.check(dimension)

Return true if the quantity's dimension matches passed dimension.

Quantity.compute(**kwargs)

Compute the Dask array wrapped by pint.PlainQuantity.

Quantity.dot(b)

Dot product of two arrays.

Quantity.from_list(quant_list[, units])

Transforms a list of Quantities into an numpy.array quantity.

Quantity.from_sequence(cls, seq[, units])

Transforms a sequence of Quantities into an numpy.array quantity.

Quantity.is_compatible_with(self, other, ...)

check if the other object is compatible

Quantity.ito([other])

Inplace rescale to different units.

Quantity.ito_base_units()

Return PlainQuantity rescaled to plain units.

Quantity.ito_reduced_units()

Return PlainQuantity scaled in place to reduced units, i.e. one unit per dimension.

Quantity.ito_root_units()

Return PlainQuantity rescaled to root units.

Quantity.m_as(units)

PlainQuantity's magnitude expressed in particular units.

Quantity.persist(**kwargs)

Persist the Dask Array wrapped by pint.PlainQuantity.

Quantity.prod(_prod_dispatcher)def prod(a[, ...])

Return the product of quantity elements over a given axis

Quantity.to([other])

Return PlainQuantity rescaled to different units.

Quantity.to_base_units()

Return PlainQuantity rescaled to plain units.

Quantity.to_compact([unit])

"Return PlainQuantity rescaled to compact, human-readable units.

Quantity.to_reduced_units()

Return PlainQuantity scaled in place to reduced units, i.e. one unit per dimension.

Quantity.to_root_units()

Return PlainQuantity rescaled to root units.

Quantity.visualize(**kwargs)

Produce a visual representation of the Dask graph.

Attributes

Quantity.default_format

Default formatting string.

Quantity.dimensionality

returns: dict -- Dimensionality of the PlainQuantity, e.g.

Quantity.dimensionless

Quantity.m

PlainQuantity's magnitude.

Quantity.magnitude

PlainQuantity's magnitude.

Quantity.u

PlainQuantity's units.

Quantity.unitless

Quantity.units

PlainQuantity's units.

default_format = '~P'

Default formatting string.

dimensionality

returns: dict – Dimensionality of the PlainQuantity, e.g. {length: 1, time: -1}

dimensionless
m

PlainQuantity’s magnitude. Short form for magnitude

magnitude

PlainQuantity’s magnitude. Long form for m

u

PlainQuantity’s units. Short form for units

unitless
units

PlainQuantity’s units. Long form for u

Examples using spectrochempy.Quantity

Units manipulation examples

Units manipulation examples