From 1ff77688171833851f128b1251813b0b252251ff Mon Sep 17 00:00:00 2001 From: gautam-404 Date: Mon, 21 Oct 2024 08:30:01 +0530 Subject: [PATCH] testing evolution termination --- mesaport/ProjectOps/ops_helper.py | 2 +- mesaport/ProjectOps/project_ops.py | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/mesaport/ProjectOps/ops_helper.py b/mesaport/ProjectOps/ops_helper.py index 4284623..25167c6 100644 --- a/mesaport/ProjectOps/ops_helper.py +++ b/mesaport/ProjectOps/ops_helper.py @@ -123,7 +123,7 @@ def run_subprocess(commands, wdir, silent=True, runlog='', status=None, print('The process raised an error:', proc.returncode, error) return False elif evo_terminated == 1: - return False + return termination_code, None else: if gyre_in is None: age = 0 diff --git a/mesaport/ProjectOps/project_ops.py b/mesaport/ProjectOps/project_ops.py index f9fa17a..d34c4c0 100644 --- a/mesaport/ProjectOps/project_ops.py +++ b/mesaport/ProjectOps/project_ops.py @@ -207,9 +207,12 @@ def run(self, silent=True, logging=True, parallel=False, trace=None, env=os.envi raise Exception("Run failed! Check runlog.") else: termination_code, age = res - print("Run successful.\n") - return termination_code, age - + if age is not None: + print("Run successful.\n") + return termination_code, age + else: + print("Run unsuccessful.\n") + return termination_code, None @@ -279,8 +282,12 @@ def resume(self, photo=None, silent=True, target=None, logging=True, parallel=Fa raise Exception("Resume from photo failed! Check runlog.") else: termination_code, age = res - print("Run successful.\n") - return termination_code, age + if age is not None: + print("Run successful.\n") + return termination_code, age + else: + print("Run unsuccessful.\n") + return termination_code, None def runGyre(self, gyre_in, files='all', wdir=None, data_format="GYRE", silent=True, target=None, logging=True, logfile="gyre.log",