Skip to content

chore(wrapper): verify Muskingum_V and DistMaxbas1 are correct for lake routing #156

Description

@MAfarrag

Context

PR #149 fixed two `AttributeError` bugs in `wrapper.py` where
nonexistent methods were called:

  • `routing.muskingum()` → `routing.Muskingum_V()`
  • `distrrm.DistMAXBAS()` → `distrrm.DistMaxbas1()`

The old methods never existed, so the `FW1Withlake` code path was
always broken. The fix chose the closest matching methods, but the
specific variants should be verified.

Problem / Current Behaviour

`Muskingum_V` is the vectorized variant (clamps negative outflow).
`Muskingum` is the iterative variant. The choice matters for model
results. Similarly, `DistMaxbas1` vs `DistMaxbas2` use different
spatial weighting strategies.

Affected locations

File Symbol Notes
`src/Hapi/wrapper.py:~275` `FW1Withlake` Uses `Muskingum_V`
`src/Hapi/wrapper.py:~286` `FW1Withlake` Uses `DistMaxbas1`

Proposed Solution

  1. Confirm with domain knowledge whether `Muskingum_V` (vectorized)
    or `Muskingum` (iterative) is correct for lake outflow routing
  2. Confirm whether `DistMaxbas1` or `DistMaxbas2` is correct for
    the FW1 framework
  3. Add a brief comment explaining the choice
  4. Add integration test covering the `FW1Withlake` code path

Effort Estimate

Size: `S`
Rationale: Domain verification + one comment + one test.

Definition of Done

  • Routing method choice confirmed and documented with a comment
  • Integration test covers the `FW1Withlake` execution path
  • Test verifies no `AttributeError` and produces reasonable output

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions