Skip to content

Commit

Permalink
check if simulation was terminated instead of succeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonk committed Dec 7, 2022
1 parent db38800 commit c43864a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/vs2dpy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,9 @@ def write_A(self) -> OrderedDict:
A = OrderedDict()
A["A01"] = f"{self.titl}\n"
A["A02"] = f"{self.tmax} {self.stim} 0. /A-2 -- TMAX, STIM, ANG\n"
A["A03"] = f"{self.zunit} {self.tunit} g J /A-3 -- ZUNIT, TUNIT, CUNX, HUNX\n"
A[
"A03"
] = f"{self.zunit} {self.tunit} g J /A-3 -- ZUNIT, TUNIT, CUNX, HUNX\n"
A["A04"] = f"{self.nxr} {self.nly} /A-4 -- NXR, NLY\n"
A["A05"] = f"{self.nrech} {self.numt} /A-5 -- NRECH, NUMT\n"
A_06 = ["F"] + ["T" if x else "F" for x in (self.itstop,)] + ["F", "F"]
Expand Down Expand Up @@ -1316,11 +1318,11 @@ def run_model(
success : boolean
buff : list of lines of stdout
"""
success = False
success = True
buff = []

# convert normal_msg to a list of lower case str for comparison
normal_msg = ["seconds"]
normal_msg = ["Simulation terminated"]

# create a list of arguments to pass to Popen
argv = []
Expand All @@ -1335,8 +1337,7 @@ def run_model(
if line:
for msg in normal_msg:
if msg in line.lower():
success = True
break
success = False
line = line.rstrip("\r\n")
if not silent:
print(line)
Expand Down

0 comments on commit c43864a

Please sign in to comment.