Skip to content

Commit

Permalink
testing evolution termination
Browse files Browse the repository at this point in the history
  • Loading branch information
gautam-404 committed Oct 21, 2024
1 parent 331258d commit e209e67
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions mesaport/ProjectOps/ops_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def run_subprocess(commands, wdir, silent=True, runlog='', status=None,
return False


evo_terminated = False
evo_terminated = None
termination_code = None
if trace is not None:
trace_values = [None for i in range(len(trace))]
Expand All @@ -80,16 +80,15 @@ def run_subprocess(commands, wdir, silent=True, runlog='', status=None,
sys.stdout.write(outline)
elif gyre_in is None:
if "terminated evolution:" in outline or "ERROR" in outline:
evo_terminated = True
termination_code = outline.split()[-1]
if "termination code:" in outline:
evo_terminated = True
evo_terminated = 1
termination_code = outline.split()[-1]
if "cannot find acceptable model" in outline:
termination_code = 'cannot find acceptable model'
evo_terminated = False
if "termination code:" in outline:
evo_terminated = 0
termination_code = outline.split()[-1]
if "photo" in outline and "does not exist" in outline:
evo_terminated = True
evo_terminated = 1
termination_code = "photo does not exist"
if not parallel:
age = process_outline(outline)
Expand Down Expand Up @@ -123,7 +122,7 @@ def run_subprocess(commands, wdir, silent=True, runlog='', status=None,
if proc.returncode or error:
print('The process raised an error:', proc.returncode, error)
return False
elif evo_terminated and termination_code != None:
elif evo_terminated == 1:
return False
else:
if gyre_in is None:
Expand Down

0 comments on commit e209e67

Please sign in to comment.