Skip to content

Commit

Permalink
fix(MfSimulationList): add missing seek to get_runtime method (#2006)
Browse files Browse the repository at this point in the history
* fix: add missing seek to get_runtime method
* too early for that assert
  • Loading branch information
mjr-deltares committed Nov 15, 2023
1 parent b34f154 commit 7cc5e6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions autotest/test_mfsimlist.py
Expand Up @@ -43,6 +43,7 @@ def test_mfsimlist_runtime(function_tmpdir):
mfsimlst = flopy.mf6.utils.MfSimulationList(function_tmpdir / "mfsim.lst")
for sim_timer in ("elapsed", "formulate", "solution"):
runtime_sec = mfsimlst.get_runtime(simulation_timer=sim_timer)

if not np.isnan(runtime_sec):
runtime_min = mfsimlst.get_runtime(
units="minutes", simulation_timer=sim_timer
Expand Down
1 change: 1 addition & 0 deletions flopy/mf6/utils/mfsimlistfile.py
Expand Up @@ -114,6 +114,7 @@ def get_runtime(
times_sec = np.sum(times * time2sec)
else:
seekpoint = self._seek_to_string(TIMERS_DICT[simulation_timer])
self.f.seek(seekpoint)
line = self.f.readline().strip()
if line == "":
return np.nan
Expand Down

0 comments on commit 7cc5e6f

Please sign in to comment.