major_surface_waters.py:102:
if isinstance(sea_stage, float):
... # constant-head branch
else:
... # time-series branch, head="sea_stage", timeseries=sea_stage
An integer stage — chd_ghb_from_major_surface_waters(ds, gwf, sea_stage=0) — is not a float, so it falls into the time-series branch and is passed to chd.ts.initialize(timeseries=0), which is not a valid (time, stage) series. The caller gets an obscure flopy error instead of a constant 0 m head.
isinstance(sea_stage, (int, float)) or np.isscalar(sea_stage) would dispatch on what the branch actually distinguishes, namely scalar-versus-series.
Low impact today (the 09pwnmodel2 call site always passes a list), but it is a trap for any new caller. Found while writing the nhflotools test suite; deliberately not pinned by a test.
major_surface_waters.py:102:An integer stage —
chd_ghb_from_major_surface_waters(ds, gwf, sea_stage=0)— is not afloat, so it falls into the time-series branch and is passed tochd.ts.initialize(timeseries=0), which is not a valid (time, stage) series. The caller gets an obscure flopy error instead of a constant 0 m head.isinstance(sea_stage, (int, float))ornp.isscalar(sea_stage)would dispatch on what the branch actually distinguishes, namely scalar-versus-series.Low impact today (the 09pwnmodel2 call site always passes a list), but it is a trap for any new caller. Found while writing the nhflotools test suite; deliberately not pinned by a test.