weldx.Q_#

class weldx.Q_(value: str, units: Optional[UnitLike] = None)#
class weldx.Q_(value: Sequence, units: Optional[UnitLike] = None)
class weldx.Q_(value: pint.quantity.Quantity[pint.quantity.Magnitude], units: Optional[UnitLike] = None)
class weldx.Q_(value: pint.quantity.Magnitude, units: Optional[UnitLike] = 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 details on working with quantities and units, 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')>