Skip to content
Snippets Groups Projects

FIX/Include run number in out -folder path if missing

Merged Karim Ahmed requested to merge fix/xfel_calibrate_update_bugs into master
All threads resolved!
1 file
+ 5
10
Compare changes
  • Side-by-side
  • Inline
@@ -769,17 +769,12 @@ def run():
caltype.upper(), datetime.now().isoformat())
if try_report_to_output:
if "out_folder" in args:
out_path = os.path.abspath(args["out_folder"])
if "run" in args:
if "run" in args and str(args["run"]) not in args["out_folder"]:
rr = args["run"]
# Only put run, when it is not in the folder path
# (e.g. out-folder from webservice conf)
if "r{:04d}/".format(rr) not in out_path and\
"{}".format(rr) not in out_path:
if isinstance(rr, int):
out_path = "{}/r{:04d}/".format(out_path, rr)
else:
out_path = "{}/{}/".format(out_path, rr)
# Only put run, when it is not in the out_folder
if isinstance(rr, int):
args["out_folder"] = "{}/{}/".format(args["out_folder"], rr)
out_path = os.path.abspath(args["out_folder"])
else:
print("No 'out_folder' defined as argument, outputting to '{}' instead.".format(
out_path))
Loading