Refactor: Generation of the finalize script
3 unresolved threads
3 unresolved threads
Merge request reports
Activity
Filter activity
491 492 cell.source += "\n%config InlineBackend.figure_formats = ['svg']\n" 492 493 493 494 495 def create_finalize_script(fmt_args, temp_path, job_list): 496 """ 497 Create a finalize script to produce output report 498 :param fmt_args: Dictionary of fmt arguments 499 :param temp_path: Path to temopary folder to run slurm job 500 :param job_list: List of slurm jobs 501 """ 502 tmpl = Template(''' 503 #!/bin/tcsh 504 source /etc/profile.d/modules.sh 505 module load texlive 506 echo 'Running finalize script' 507 python3 -c "from cal_tools.tools import finalize; changed this line in version 2 of the diff
505 module load texlive 506 echo 'Running finalize script' 507 python3 -c "from cal_tools.tools import finalize; 508 finalize({{joblist}}, $1, '{{run_path}}', '{{out_path}}', 509 '{{project}}', '{{calibration}}', '{{author}}', 510 '{{version}}', '{{report_to}}', '{{in_folder}}' )" 511 512 ''') 513 514 fmt_args['joblist'] = job_list 515 f_name = "{}/finalize.sh".format(temp_path) 516 with open(f_name, "w") as finfile: 517 finfile.write(textwrap.dedent(tmpl.render(**fmt_args))) 518 519 all_stats = stat.S_IXUSR | stat.S_IWUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH 520 os.chmod(f_name, all_stats) 502 tmpl = Template(''' 503 #!/bin/tcsh 504 source /etc/profile.d/modules.sh 505 module load texlive 506 echo 'Running finalize script' 507 python3 -c "from cal_tools.tools import finalize; 508 finalize({{joblist}}, $1, '{{run_path}}', '{{out_path}}', 509 '{{project}}', '{{calibration}}', '{{author}}', 510 '{{version}}', '{{report_to}}', '{{in_folder}}' )" 511 512 ''') 513 514 fmt_args['joblist'] = job_list 515 f_name = "{}/finalize.sh".format(temp_path) 516 with open(f_name, "w") as finfile: 517 finfile.write(textwrap.dedent(tmpl.render(**fmt_args))) added 12 commits
-
6bc340ee...721531f3 - 11 commits from branch
master
- 5cb0e21a - Refactor generation of the finalize script
-
6bc340ee...721531f3 - 11 commits from branch
mentioned in commit bc78a342
Please register or sign in to reply