Skip to content

Module unitexpr.quantity

None

None

View Source
from numbers import Number

from .qarray import qarray

def quantity(value: Number, unit=1.0, info=""):

    """

    Constructs a quantity described by

    a numerical value or a numerical array,

    a unit and an optional string

    containing additional information.

    The instance attribute `info` can be used to store

    object documentation.

    """

    return qarray.from_input(value, unit=unit, info=info)

Functions

quantity

def quantity(
    value: numbers.Number,
    unit=1.0,
    info=''
)

Constructs a quantity described by

a numerical value or a numerical array, a unit and an optional string containing additional information. The instance attribute info can be used to store object documentation.

View Source
def quantity(value: Number, unit=1.0, info=""):

    """

    Constructs a quantity described by

    a numerical value or a numerical array,

    a unit and an optional string

    containing additional information.

    The instance attribute `info` can be used to store

    object documentation.

    """

    return qarray.from_input(value, unit=unit, info=info)