From 86f5be4545ac7650a5b124608f2a1b90b767865d Mon Sep 17 00:00:00 2001
From: Robert Rosca <robert.rosca@xfel.eu>
Date: Fri, 7 May 2021 09:35:21 +0200
Subject: [PATCH] Oops, re-implement multiple pythonpath slurm_calibrate.sh
 options

---
 bin/slurm_calibrate.sh          | 5 +++--
 src/xfel_calibrate/calibrate.py | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/slurm_calibrate.sh b/bin/slurm_calibrate.sh
index 05a04cba4..9e5088757 100755
--- a/bin/slurm_calibrate.sh
+++ b/bin/slurm_calibrate.sh
@@ -10,6 +10,7 @@ caltype=$6
 final=$7
 finalize=$8
 cluster_cores=$9
+notebook_python_path=$10
 
 echo "Running with the following parameters:"
 echo "Notebook path: $nb_path"
@@ -43,8 +44,8 @@ fi
 
 
 echo "Running notebook"
-${python_path} -m princess ${nb_path} --save --on-error-resume-next
-${python_path} -m nbconvert --to rst --TemplateExporter.exclude_input=True ${nb_path}
+${notebook_python_path} -m princess ${nb_path} --save --on-error-resume-next
+${notebook_python_path} -m nbconvert --to rst --TemplateExporter.exclude_input=True ${nb_path}
 
 # stop the cluster if requested
 if [ "${ipcluster_profile}" != "NO_CLUSTER" ]
diff --git a/src/xfel_calibrate/calibrate.py b/src/xfel_calibrate/calibrate.py
index 109cdbd82..4068a07b6 100755
--- a/src/xfel_calibrate/calibrate.py
+++ b/src/xfel_calibrate/calibrate.py
@@ -757,14 +757,15 @@ def concurrent_run(
     srun_base += [
         os.path.join(PKG_DIR, "bin", "slurm_calibrate.sh"),  # path to helper sh
         os.path.abspath(nbpath),  # path to notebook
-        user_venv + "/bin/python" if user_venv else python_path,  # path to python
+        python_path,  # path to python
         cluster_profile,
         '"{}"'.format(base_name.upper()),
         '"{}"'.format(args["detector"].upper()),
         '"{}"'.format(args["type"].upper()),
         "FINAL" if final_job else "NONFINAL",
         "{}/finalize.py".format(os.path.abspath(temp_path)),
-        str(cluster_cores)
+        str(cluster_cores),
+        user_venv + "/bin/python" if user_venv else python_path  # used for nb execution
     ]
 
     output = check_output(srun_base).decode('utf8')
-- 
GitLab