hipscatalog_gen.selection.resolve_value_range

resolve_value_range(ddf, value_col, range_mode, min_cfg, max_cfg, hist_nbins, compute_hist_fn, diag_ctx, log_fn, label)[source]

Resolve [min, max] for score-like columns with optional histogram peak.

Parameters:
  • ddf (Any) – Dask-like collection with the target column.

  • value_col (str) – Column name to inspect.

  • range_mode (str) – Either "complete" or "hist_peak".

  • min_cfg (float | None) – Optional configured minimum.

  • max_cfg (float | None) – Optional configured maximum.

  • hist_nbins (int) – Number of bins for histogram estimation.

  • compute_hist_fn (Callable[[Any, str, float, float, int], Tuple[ndarray, ndarray, int]]) – Callable to compute histograms (signature-compatible with compute_histogram_ddf).

  • diag_ctx – Diagnostics context factory.

  • log_fn – Logging callback.

  • label (str) – Human-readable label for logging and error messages.

Returns:

Tuple (min_value, max_value) resolved according to the mode.

Raises:
  • ValueError – When ranges are invalid, non-finite, or histogram estimation fails.

  • RuntimeError – When required bounds are missing for the chosen mode.

Return type:

tuple[float, float]