Skip to content

bug(rrm): BaseConceptualModel signatures mismatch HBV implementations #154

Description

@MAfarrag

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

  • All base class method signatures match HBV implementations
  • `# type: ignore[override]` comments removed from HBV/HBVBergestrom92
  • Docstring parameter names match actual function signatures
  • `response` return type annotation is 4-tuple
  • mypy passes without override suppressions for these methods
  • Existing tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions