check_boundaries

check_boundaries#

jetset.obs_constrain.check_boundaries(val, val_min, val_max, val_name, silent=False)[source]#

Clamp a value to bounds and report if clipping occurred.

Parameters:
  • val (float) – Candidate value.

  • val_min (float) – Lower bound.

  • val_max (float) – Upper bound.

  • val_name (str) – Value label used for diagnostic prints.

  • silent (bool, optional) – If True, suppress progress messages.

Returns:

(value, failed) where failed is True if clipping occurred.

Return type:

tuple