From e89a41d2f2e561d7c869edf1091758afea84e50b Mon Sep 17 00:00:00 2001 From: Joseph Hughes Date: Tue, 14 Nov 2023 13:15:21 -0600 Subject: [PATCH] * update MfSimulationList runtime function --- flopy/mf6/utils/mfsimlistfile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flopy/mf6/utils/mfsimlistfile.py b/flopy/mf6/utils/mfsimlistfile.py index 9289de0790..387da10be7 100644 --- a/flopy/mf6/utils/mfsimlistfile.py +++ b/flopy/mf6/utils/mfsimlistfile.py @@ -42,7 +42,7 @@ def get_runtime( self, units: str = "seconds", simulation_timer: str = "elapsed" ) -> float: """ - Get the elapsed runtime of the model from the list file. + Get model runtimes from the simulation list file. Parameters ---------- @@ -100,7 +100,7 @@ def get_runtime( if simulation_timer == "elapsed": seekpoint = self._seek_to_string(TIMERS_DICT[simulation_timer]) self.f.seek(seekpoint) - line = self.f.readline() + line = self.f.readline().strip() if line == "": return np.nan @@ -114,7 +114,7 @@ def get_runtime( times_sec = np.sum(times * time2sec) else: seekpoint = self._seek_to_string(TIMERS_DICT[simulation_timer]) - line = self.f.readline() + line = self.f.readline().strip() if line == "": return np.nan times_sec = float(line.split()[3]) @@ -128,7 +128,7 @@ def get_runtime( def get_outer_iterations(self) -> int: """ - Get the total outer iterations from the list file. + Get the total outer iterations from the simulation list file. Parameters ---------- @@ -157,7 +157,7 @@ def get_outer_iterations(self) -> int: def get_total_iterations(self) -> int: """ - Get the total number of iterations from the list file. + Get the total number of iterations from the simulation list file. Parameters ---------- @@ -279,7 +279,7 @@ def _seek_to_string(self, s): def _rewind_file(self): """ - Rewind the mfsim.lst file + Rewind the simulation list file Returns -------