Skip to content

sift_client.util.test_results.bounds

FUNCTION DESCRIPTION
assign_value_to_measurement

Resolve value type from a given value and assign it to a measurement.

evaluate_measurement_bounds

Update a measurement with the resolved bounds type and result of evaluating the given value against those bounds.

assign_value_to_measurement

assign_value_to_measurement(
    measurement: TestMeasurement
    | TestMeasurementCreate
    | TestMeasurementUpdate,
    value: float | str | bool,
) -> None

Resolve value type from a given value and assign it to a measurement.

PARAMETER DESCRIPTION
measurement

The measurement to assign the value to.

TYPE: TestMeasurement | TestMeasurementCreate | TestMeasurementUpdate

value

The value to resolve and assign to the measurement.

TYPE: float | str | bool

evaluate_measurement_bounds

evaluate_measurement_bounds(
    measurement: TestMeasurement
    | TestMeasurementCreate
    | TestMeasurementUpdate,
    value: float | str | bool,
    bounds: dict[str, float]
    | NumericBounds
    | str
    | bool
    | None,
) -> bool

Update a measurement with the resolved bounds type and result of evaluating the given value against those bounds.

PARAMETER DESCRIPTION
measurement

The measurement to update.

TYPE: TestMeasurement | TestMeasurementCreate | TestMeasurementUpdate

value

The value to evaluate the bounds of.

TYPE: float | str | bool

bounds

The bounds to evaluate the value against. Either a dictionary with "min" and "max" keys, a NumericBounds object, a string, a boolean, or None.

TYPE: dict[str, float] | NumericBounds | str | bool | None

RETURNS DESCRIPTION
bool

True if the value is within the bounds, False otherwise.