Evaluator

hy2dl.evaluation.evaluator.calculate_metrics(ds_results: Dataset | Path, metric_name: list[str] = ['all'], forecast_mode: bool = False, distribution=None, filter_mask: DataArray = None) DataArray

Calculate a list of metrics

Parameters:
  • ds_results (xr.Dataset | Path) – Dataset loaded from the evaluation Zarr.

  • metric_name (list[str]) – List of metric names to calculate, or [“all”] to run all valid metrics.

  • forecast_mode (bool) – True if the dataset is from a forecast model (with lead_time dimension).

  • distribution (str, optional) – Distribution string required for calculating probabilistic metrics like NLL.

  • filter_mask (xr.DataArray, optional) – Boolean DataArray to filter values during evaluation. Expected dims (gauge_id, date).

Returns:

DataArray containing the calculated metrics.

Return type:

xr.DataArray