weldx.Q_

class weldx.Q_(value, units=None)

Create a quantity from a scalar or array.

The quantity class supports lots of physical units and will combine them during mathematical operations. For extended details on working with quantities, please see the pint documentation

Examples

>>> from weldx import Q_
>>> length = Q_(10, "mm")
>>> length
<Quantity(10, 'millimeter')>

define a time:

>>> time = Q_(1, "s")
>>> time
<Quantity(1, 'second')>

lets combine length and time to get a velocity.

>>> v = length / time
>>> v
<Quantity(10.0, 'millimeter / second')>

Methods

check

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

clip

compare

compatible_units

compute

Compute the Dask array wrapped by pint.Quantity.

dot

Dot product of two arrays.

fill

format_babel

from_list

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

from_sequence

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

from_tuple

is_compatible_with

check if the other object is compatible

ito

Inplace rescale to different units.

ito_base_units

Return Quantity rescaled to base units.

ito_reduced_units

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

ito_root_units

Return Quantity rescaled to root units.

m_as

Quantity's magnitude expressed in particular units.

persist

Persist the Dask Array wrapped by pint.Quantity.

plus_minus

prod

Return the product of quantity elements over a given axis

put

searchsorted

to

Return Quantity rescaled to different units.

to_base_units

Return Quantity rescaled to base units.

to_compact

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

to_reduced_units

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

to_root_units

Return Quantity rescaled to root units.

to_timedelta

to_tuple

tolist

visualize

Produce a visual representation of the Dask graph.

Attributes

T

UnitsContainer

debug_used

default_format

Default formatting string.

dimensionality

returns

Dimensionality of the Quantity, e.g. {length: 1, time: -1}

dimensionless

flat

force_ndarray

force_ndarray_like

imag

m

Quantity's magnitude.

magnitude

Quantity's magnitude.

real

shape

u

Quantity's units.

unitless

units

Quantity's units.