real_weight_inference

real_weight_inference(weight_array, threshold) tuple[bool, float][source]

Determines if a sequence of weight measurements represents a stable weight.

Conditions to call it a real weight:
  • standard deviation of the last 5 measurements is

    smaller than 10% of the threshold

Parameters:
  • weight_array (list | np.ndarray) – Array of weight measurements.

  • threshold (float) – Threshold for stability check.

Returns:

(True, median_weight) if stable, else (False, 0.0).

Return type:

tuple[bool, float]