Skip to content

models.calibration

Calibration model registry and orchestration.

This module provides calibration algorithms (SCE-UA) and orchestrates the calibration process using snow and hydro models.

get_config

get_config(
    model: Algorithm,
) -> list[dict[str, str | int | float | bool | None]]

Get calibration algorithm configuration.

Source code in src/holmes/models/calibration.py
def get_config(
    model: Algorithm,
) -> list[dict[str, str | int | float | bool | None]]:
    """Get calibration algorithm configuration."""
    match model:
        case "sce":
            return [
                {
                    "name": "seed",
                    "min": 0,
                    "max": None,
                    "default": 0,
                    "integer": True,
                },
                {
                    "name": "n_complexes",
                    "min": 1,
                    "max": None,
                    "default": 25,
                    "integer": True,
                },
                {
                    "name": "k_stop",
                    "min": 1,
                    "max": None,
                    "default": 10,
                    "integer": True,
                },
                {
                    "name": "p_convergence_threshold",
                    "min": 0,
                    "max": 1,
                    "default": 0.1,
                    "integer": False,
                },
                {
                    "name": "geometric_range_threshold",
                    "min": 0,
                    "max": None,
                    "default": 0.001,
                    "integer": False,
                },
                {
                    "name": "max_evaluations",
                    "min": 1,
                    "max": None,
                    "default": 5000,
                    "integer": True,
                },
            ]
        case _:  # pragma: no cover
            assert_never(model)  # type: ignore