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.
dot
(b)Dot product of two arrays.
fill
(value)- rtype:
format_babel
([spec])- rtype:
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])- rtype:
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
()- rtype:
to_tuple
()tolist
()visualize
(**kwargs)Produce a visual representation of the Dask graph.
Attributes
T
UnitsContainer
default_format
Default formatting string.
dimensionality
- returns:
Dimensionality of the PlainQuantity, e.g.
{length: 1, time: -1}
dimensionless
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.
- to(other=None, *contexts, **ctx_kwargs)[source]#
Return Quantity rescaled to other units or normalisation
Raises
PyroNormalisationError
if value is NaN, as this indicates required physical reference values are missing