dcc_quantities.dcc_math

Math function to be used over all instances of the DccQuantities package.

All functions defined within the module are a wrapper to their analogous metas_unclib.umath functions. These functions diverge from the umath functions as they work only for instances of DccQuantityType and SiRealList.

log

log(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the natural logarithm of a, where a is adimensional DCC Quantity data.

Raises:
  • UnitError

    When the unit of the provided data is not adimensional.

log10

log10(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the base-10 logarithm of a, where a is adimensional DCC Quantity data.

Raises:
  • UnitError

    When the unit of the provided data is not adimensional.

exp

exp(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return e raised to the power a, where e = 2.718281… is the base of natural logarithms and a is adimensional DCC Quantity data.

Raises:
  • UnitError

    When the unit of the provided data is not adimensional.

sqrt

sqrt(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the square root of a, where a is DCC Quantity data.

Raises:
  • NotImplementedError

    When any of the provided data becomes complex, it would be expected to have an SiComplexList instance as the result Quantity data. However, currently only SiRealList are supported. This exception will be removed when the library supports SiComplexList.

abs

abs(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return a copy of the Dcc Quantity Data where all values are absolute. The function is analogous to abs(a).

sin

sin(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the sine of the quantity data.

The function is valid only for quantity data which unit is 'radians', any of its D-SI units derivatives or adimensional. The returned quantity data is always set with the unit 'one'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional, 'radians' nor any of its derivate DSI units.

cos

cos(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the cosine of the quantity data.

The function is valid only for quantity data which unit is 'radians', any of its D-SI units derivatives or adimensional. The returned quantity data is always set with the unit 'one'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional, 'radians' nor any of its derivate DSI units.

tan

tan(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the tangent of the quantity data.

The function is valid only for quantity data which unit is 'radians', any of its D-SI units derivatives or adimensional. The returned quantity data is always set with the unit 'one'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional, 'radians' nor any of its derivate DSI units.

sinh

sinh(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the hyperbolic sine of the quantity data.

The function is valid only for quantity data which unit is 'radians', any of its D-SI units derivatives or adimensional. The returned quantity data is always set with the unit 'one'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional, 'radians' nor any of its derivate DSI units.

cosh

cosh(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the hyperbolic cosine of the quantity data.

The function is valid only for quantity data which unit is 'radians', any of its D-SI units derivatives or adimensional. The returned quantity data is always set with the unit 'one'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional, 'radians' nor any of its derivate DSI units.

tanh

tanh(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the hyperbolic tangent of the quantity data.

The function is valid only for quantity data which unit is 'radians', any of its D-SI units derivatives or adimensional. The returned quantity data is always set with the unit 'one'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional, 'radians' nor any of its derivate DSI units.

asin

asin(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the arc sine (inverse sine) of the quantity data. arcsin is an alias for this function.

The function is valid only for quantity data which unit is adimensional. The returned quantity data is always set with the unit 'radians'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional.

  • NumericDomainError

    When any of the data values is not within the arc sine domain. The arc sine domain is defined as all natural numbers in the range [-1, 1].

acos

acos(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the arc cosine (inverse cosine) of the quantity data. arccos is an alias for this function.

The function is valid only for quantity data which unit is adimensional. The returned quantity data is always set with the unit 'radians'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional.

  • NumericDomainError

    When any of the data values is not within the arc sine domain. The arc sine domain is defined as all natural numbers in the range [-1, 1].

atan

atan(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the arc tangent (inverse tangent) of the quantity data. arctan is an alias for this function.

The function is valid only for quantity data which unit is adimensional. The returned quantity data is always set with the unit 'radians'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional.

  • NumericDomainError

    When any of the data values is not within the arc sine domain. The arc sine domain is defined as all natural numbers.

asinh

asinh(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the inverse hyperbolic sine of the quantity data. arcsinh is an alias for this function.

The function is valid only for quantity data which unit is adimensional. The returned quantity data is always set with the unit 'radians'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional.

  • NumericDomainError

    When any of the data values is not within the arc sine domain. The arc sine domain is defined as all natural numbers.

acosh

acosh(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the inverse hyperbolic cosine of the quantity data. arccosh is an alias for this function.

The function is valid only for quantity data which unit is adimensional. The returned quantity data is always set with the unit 'radians'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional.

  • NumericDomainError

    When any of the data values is not within the arc sine domain. The arc sine domain is defined as all natural numbers equal or greater than 1.

atanh

atanh(a: DccQuantityType | SiRealList) -> DccQuantityType | SiRealList

Return the inverse hyperbolic tangent of the quantity data. arctanh is an alias for this function.

The function is valid only for quantity data which unit is adimensional. The returned quantity data is always set with the unit 'radians'.

Raises:
  • UnitError

    When the unit of the quantity data is not adimensional.

  • NumericDomainError

    When any of the data values is not within the arc sine domain. The arc sine domain is defined as all natural numbers in the range [-1, 1].