pyrokinetics.units.PyroQuantity#

class pyrokinetics.units.PyroQuantity(value: MagnitudeT, units: UnitLike | None = None)[source]#
class pyrokinetics.units.PyroQuantity(value: str, units: UnitLike | None = None)
class pyrokinetics.units.PyroQuantity(value: Sequence[ScalarT], units: UnitLike | None = None)
class pyrokinetics.units.PyroQuantity(value: PlainQuantity[Any], units: UnitLike | None = None)

Bases: Quantity

__init__()#

Methods

__init__()

check(dimension)

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

clip([min, max, out])

compare(*args, **kwargs)

compatible_units(*contexts)

compute(**kwargs)

Compute the Dask array wrapped by pint.PlainQuantity.

convert_physical_units(norm)

Replace Phyiscal Units by their corresponding Simulation unit

dot(b)

Dot product of two arrays.

fill(value)

format_babel([spec])

from_list(quant_list[, units])

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

from_sequence(seq[, units])

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

from_tuple(tup)

is_compatible_with(other, *contexts, ...)

check if the other object is compatible

ito([other])

Inplace rescale to different units.

ito_base_units()

Return PlainQuantity rescaled to plain units.

ito_preferred([preferred_units])

Return Quantity converted to a unit composed of the preferred units.

ito_reduced_units()

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

ito_root_units()

Return PlainQuantity rescaled to root units.

m_as(units)

PlainQuantity's magnitude expressed in particular units.

persist(**kwargs)

Persist the Dask Array wrapped by pint.PlainQuantity.

plus_minus(error[, relative])

prod([axis, dtype, out, keepdims, initial, ...])

Return the product of quantity elements over a given axis

put(indices, values[, mode])

searchsorted(v[, side, sorter])

to([other])

Return Quantity rescaled to other units or normalisation

to_base_units([system])

Return PlainQuantity rescaled to plain units.

to_compact([unit])

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

to_preferred([preferred_units])

Return Quantity converted to a unit composed of the preferred units.

to_reduced_units()

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

to_root_units()

Return PlainQuantity rescaled to root units.

to_timedelta()

to_tuple()

tolist()

unit_items()

A view of the unit items.

visualize(**kwargs)

Produce a visual representation of the Dask graph.

Attributes

T

UnitsContainer

dimensionality

dimensionless

dtype

flat

force_ndarray

force_ndarray_like

imag

m

PlainQuantity's magnitude.

magnitude

PlainQuantity's magnitude.

ndim

real

shape

u

PlainQuantity's units.

unitless

units

PlainQuantity's units.

default_format

convert_physical_units(norm)[source]#

Replace Phyiscal Units by their corresponding Simulation unit

to(other=None, *contexts, **ctx_kwargs)[source]#

Return Quantity rescaled to other units or normalisation

Raises:

PyroNormalisationError – If other is a Normalisation and the value cannot be converted. This indicates required physical reference values are missing

to_base_units(system=None)[source]#

Return PlainQuantity rescaled to plain units.

Parameters:

system (str | None)