Skip to content
Snippets Groups Projects
Commit e7237157 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Merge branch 'slurm-fixes' into 'master'

Some cleanup in calibrate.py

See merge request detectors/pycalibration!331
parents 6a2f8c73 edb6018c
No related branches found
No related tags found
1 merge request!331Some cleanup in calibrate.py
This diff is collapsed.
......@@ -263,15 +263,18 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
lead_rstfiles = ['InputParameters.rst', 'timing_summary.rst']
# Order rst files based on the known order(lead_rstfiles).
for f in direntries:
# TODO: fix order somewhere else instead of munging filenames
def sort_key(f):
if f in lead_rstfiles:
direntries.insert(lead_rstfiles.index(f),
direntries.pop(direntries.index(f)))
# Move summary to the top, if it is exists,
# after the known leading rst files.
if "summary" in f.lower() and f not in lead_rstfiles:
direntries.insert(len(lead_rstfiles),
direntries.pop(direntries.index(f)))
return lead_rstfiles.index(f), f
elif "summary" in f.lower():
return len(lead_rstfiles), f
elif "precorrection" in f.lower():
return len(lead_rstfiles) + 1, f
else:
return len(lead_rstfiles) + 2, f
direntries.sort(key=sort_key)
files_to_handle = []
for entry in direntries:
if isfile("{}/{}".format(run_path, entry)):
......
import os
# path into which temporary files from each run are placed
temp_path = "{}/temp/".format(os.getcwd())
temp_path = os.path.abspath("temp/")
# Path to use for calling Python. If the environment is correctly set, simply the command
python_path = "python"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment