NumericValue

class verta.data_types.NumericValue(value, unit=None)

Representation of a number.

Parameters:
  • value (float) – Number.

  • unit (str) – Unit of measurement.

Examples

from verta.data_types import NumericValue
data = NumericValue(4, unit="lbs")
run.log_attribute("weight", data)
diff(other)

Calculate the difference between other and this value.

Parameters:

other (NumericValue) – Value to calculate difference from.

Returns:

float – Relative difference between the values.

Notes

This method uses relative difference:

\[\text{diff}=\left\lvert\frac{\text{self}-\text{other}}{\text{other}}\right\rvert\]