diff --git a/mesaport/ProjectOps/ops_helper.py b/mesaport/ProjectOps/ops_helper.py index 8b78b3d..65aa5fc 100644 --- a/mesaport/ProjectOps/ops_helper.py +++ b/mesaport/ProjectOps/ops_helper.py @@ -41,16 +41,16 @@ def run_subprocess(commands, wdir, silent=True, runlog='', status=None, if gyre_in is not None: gyre_obj = GyreAccess() if parallel: - num = filename.split(".")[0] - new_gyre_in = os.path.join(wdir, f"gyre{num}.in") + profile_num = filename.split('/')[-1].split(f".{data_format}")[0] + new_gyre_in = os.path.join(wdir, f"gyre{profile_num}.in") gyre_obj.modify_gyre_params(wdir, filename, data_format, gyre_in=new_gyre_in) gyre_obj.set(arg=gyre_input_params, wdir=wdir, gyre_in=new_gyre_in) time.sleep(1) # Update gyre_in to the new file gyre_in = new_gyre_in - commands = commands.replace("gyre.in", f"gyre{num}.in") - runlog = runlog.replace("gyre.log", f"gyre{num}.log") + commands = commands.replace("gyre.in", f"gyre{profile_num}.in") + runlog = runlog.replace("gyre.log", f"gyre{profile_num}.log") else: new_gyre_in = os.path.join(wdir, "gyre.in") shutil.copyfile(gyre_in, new_gyre_in)