major_surface_waters.py:129:
ts_sea = chd.ts.initialize(
filename="sea_lvl.ts", time_series_namerecord="sea_stage", ...
)
flopy's child-package initialize returns None, so the third element of the returned tuple is None on every path — both the chd is None guard and the successful branch. Verified empirically on flopy 3.11.0.dev0:
chd is None? False
ts_sea returned: None
but chd.ts exists: True
The model itself is unaffected: the time series really is attached to the CHD package and chd.ts is usable. What is wrong is the API surface — the docstring promises flopy.mf6.ModflowGwfts or None, and the if chd is None branch implies a caller can distinguish the two cases from the return value. Any caller that does ghb, chd, ts = ...; if ts is not None: silently takes the wrong path.
Either return chd.ts explicitly, or drop the third return value and document that the series lives on the CHD package.
Found while writing the test suite; the test asserts the time series is wired onto chd.ts rather than pinning the None.
major_surface_waters.py:129:flopy's child-package
initializereturnsNone, so the third element of the returned tuple isNoneon every path — both thechd is Noneguard and the successful branch. Verified empirically on flopy 3.11.0.dev0:The model itself is unaffected: the time series really is attached to the CHD package and
chd.tsis usable. What is wrong is the API surface — the docstring promisesflopy.mf6.ModflowGwfts or None, and theif chd is Nonebranch implies a caller can distinguish the two cases from the return value. Any caller that doesghb, chd, ts = ...; if ts is not None:silently takes the wrong path.Either return
chd.tsexplicitly, or drop the third return value and document that the series lives on the CHD package.Found while writing the test suite; the test asserts the time series is wired onto
chd.tsrather than pinning theNone.