From a4ede288288bfc9f16af1bfed6aecdd82778c2f6 Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas.kluyver@xfel.eu>
Date: Thu, 9 Jul 2020 14:00:20 +0200
Subject: [PATCH] Avoid clashing variable name leading to wrong notebook name

---
 xfel_calibrate/calibrate.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py
index b84de4027..b8d5a496e 100755
--- a/xfel_calibrate/calibrate.py
+++ b/xfel_calibrate/calibrate.py
@@ -890,13 +890,13 @@ def run():
         joblist = []
         cluster_cores = concurrency.get("cluster cores", 8)
         # Check if there are pre-notebooks
-        for i, notebook in enumerate(pre_notebooks):
+        for i, rel_path in enumerate(pre_notebooks):
             notebook_path = os.path.abspath(
-                "{}/{}".format(os.path.dirname(__file__), notebook))
+                "{}/{}".format(os.path.dirname(__file__), rel_path))
             with open(notebook_path, "r") as f:
                 lead_nb = nbformat.read(f, as_version=4)
                 jobid = concurrent_run(run_tmp_path, lead_nb,
-                                       os.path.basename(notebook),
+                                       os.path.basename(notebook_path),
                                        args,
                                        job_list=joblist, fmt_args=fmt_args,
                                        cluster_cores=cluster_cores,
-- 
GitLab