Skip to content

Commit

Permalink
Refactor execution call in run.py
Browse files Browse the repository at this point in the history
Moved the _execute() call out of the script string construction for
compatibility with Python 3.11. This change assigns the _execute call result
to a variable before joining it into the final script.
  • Loading branch information
douglatornell committed Nov 12, 2024
1 parent 40dc91c commit b178b0b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions salishsea_cmd/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,14 +671,20 @@ def _build_batch_script(
)
)
redirect_stdout_stderr = True if SYSTEM == "salish" else False
execute_section = _execute(
nemo_processors,
xios_processors,
deflate,
max_deflate_jobs,
separate_deflate,
redirect_stdout_stderr,
)
script = "\n".join(
(
script,
f"{_definitions(run_desc, desc_file, run_dir, results_dir, deflate)}\n"
f"{_modules()}\n"
f"{_execute(
nemo_processors, xios_processors, deflate, max_deflate_jobs, separate_deflate,
redirect_stdout_stderr)}\n"
f"{execute_section}\n"
f"{_fix_permissions()}\n"
f"{_cleanup()}",
)
Expand Down

0 comments on commit b178b0b

Please sign in to comment.