Context
PR review of #149 found that the abstract base class
`BaseConceptualModel` defines method signatures that don't match the
concrete `HBV` and `HBVBergestrom92` implementations. This causes
`# type: ignore[override]` suppressions throughout and makes the
base class contract misleading.
Related: #140, #142, #145
Problem / Current Behaviour
Signature mismatches
| Method |
Base class |
HBV |
Issue |
| `precipitation` |
Missing `prec` param, has unused `pcorr` |
Has `prec`, no `pcorr` |
Param mismatch |
| `snow` |
`(temp, ttm, cfmax, ...)` |
`(cfmax, temp, ttm, ...)` |
Param order swapped |
| `response` |
Returns `tuple[float, float, float]` |
Returns 4-tuple |
Return arity mismatch |
| `simulate` |
`(prec, temp, et, ll_temp, par, ...)` |
`(prec, temp, et, par, init_st, ll_temp, ...)` |
Param order swapped |
| `soil` |
Docstring uses `infiltration` |
HBV uses `inf` |
Param name mismatch |
Affected locations
| File |
Symbol |
Notes |
| `src/Hapi/rrm/base_model.py` |
`BaseConceptualModel` |
All 6 abstract methods |
| `src/Hapi/rrm/hbv.py` |
`HBV` |
All overridden methods |
| `src/Hapi/rrm/hbv_bergestrom92.py` |
`HBVBergestrom92` |
All overridden methods |
Proposed Solution
Align the base class signatures with the actual HBV implementation
(which is the only actively used variant), or make the base class
use `*args, **kwargs` with documentation of the expected interface.
Out of Scope
Effort Estimate
Size: `M`
Rationale: Requires careful alignment of 6 method signatures
across 3 files without breaking existing callers.
Definition of Done
Context
PR review of #149 found that the abstract base class
`BaseConceptualModel` defines method signatures that don't match the
concrete `HBV` and `HBVBergestrom92` implementations. This causes
`# type: ignore[override]` suppressions throughout and makes the
base class contract misleading.
Related: #140, #142, #145
Problem / Current Behaviour
Signature mismatches
Affected locations
Proposed Solution
Align the base class signatures with the actual HBV implementation
(which is the only actively used variant), or make the base class
use `*args, **kwargs` with documentation of the expected interface.
Out of Scope
BaseHBVModel#142, Deduplicate hydrological routines across HBV variants #145)Effort Estimate
Size: `M`
Rationale: Requires careful alignment of 6 method signatures
across 3 files without breaking existing callers.
Definition of Done