From d546505c1fda48ba26085e2011792ab3fa29ebbb Mon Sep 17 00:00:00 2001 From: Karim Ahmed <karim.ahmed@xfel.eu> Date: Thu, 19 Mar 2020 11:53:48 +0100 Subject: [PATCH] MR comments --- xfel_calibrate/calibrate.py | 10 +++++----- xfel_calibrate/finalize.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py index db8123a60..fdccb8b90 100755 --- a/xfel_calibrate/calibrate.py +++ b/xfel_calibrate/calibrate.py @@ -682,12 +682,12 @@ def concurrent_run(temp_path, nb, nbname, args, cparm=None, cval=None, return jobid -def make_par_table(parms, run_temp_path): +def make_par_table(parms, run_tmp_path): """ - Create a table with input parameters if the notebook + Create a table with input parameters of the notebook :param parms: parameters of the notebook - :param run_temp_path: path to temporary directory for running job outputs + :param run_tmp_path: path to temporary directory for running job outputs """ # Add space in long strings without line breakers ` ,-/` to @@ -743,7 +743,7 @@ def make_par_table(parms, run_temp_path): \end{longtable} ''') - f_name = "{}/InputParameters.rst".format(run_temp_path) + f_name = "{}/InputParameters.rst".format(run_tmp_path) with open(f_name, "w") as finfile: finfile.write(textwrap.dedent(tmpl.render(p=col_type, lines=l_parms))) @@ -835,7 +835,7 @@ def run(): # Write all input parameters to rst file to be included to final report parms = parameter_values(parms, **args) - make_par_table(parms, temp_path, run_uuid) + make_par_table(parms, run_tmp_path) save_executed_command(run_tmp_path, version) # wait on all jobs to run and then finalize the run by creating a report from the notebooks diff --git a/xfel_calibrate/finalize.py b/xfel_calibrate/finalize.py index 4a912bc61..fd099370b 100644 --- a/xfel_calibrate/finalize.py +++ b/xfel_calibrate/finalize.py @@ -277,8 +277,8 @@ def make_report(run_path, tmp_path, out_path, project, author, version, temp_dirs = glob(f'{tmp_path}/*/') # Remove folders with figures and sphinx files. print(f"Removing directories [{temp_dirs}] in temp folder: {tmp_path}") - - [rmtree(f'{dtmp}/') for dtmp in temp_dirs] + for dtmp in temp_dirs: + rmtree(f'{dtmp}/') # Moving temporary files to out-folder after successful execution # This helps in keeping elements needed for re-producibility. -- GitLab