Context
PR #149 added type annotations to `Run.init` which made an
existing inheritance defect more visible. `Run` inherits from
`Catchment` but its `init` only sets `self.Qsim` without
calling `super().init()`.
Problem / Current Behaviour
```python
class Run(Catchment):
def init(self, *args, **kwargs):
self.Qsim: np.ndarray | pd.DataFrame | None = None
```
Instantiating `Run()` directly creates an object missing all 45+
Catchment attributes. The class only works because callers construct
a `Catchment` first, populate its attributes via `read_*()` methods,
and then call `Run` methods on the same object.
Affected locations
| File |
Symbol |
Notes |
| `src/Hapi/run.py:35-37` |
`Run.init` |
Missing `super().init()` |
Proposed Solution
Either:
- Add `super().init(*args, **kwargs)` to `Run.init`
- Or document the intended usage pattern (construct Catchment, then
call Run methods) and remove the misleading `init`
Effort Estimate
Size: `S`
Definition of Done
Context
PR #149 added type annotations to `Run.init` which made an
existing inheritance defect more visible. `Run` inherits from
`Catchment` but its `init` only sets `self.Qsim` without
calling `super().init()`.
Problem / Current Behaviour
```python
class Run(Catchment):
def init(self, *args, **kwargs):
self.Qsim: np.ndarray | pd.DataFrame | None = None
```
Instantiating `Run()` directly creates an object missing all 45+
Catchment attributes. The class only works because callers construct
a `Catchment` first, populate its attributes via `read_*()` methods,
and then call `Run` methods on the same object.
Affected locations
Proposed Solution
Either:
call Run methods) and remove the misleading `init`
Effort Estimate
Size: `S`
Definition of Done