From 108a081302e736896ebbcd8a9fc67132515176b2 Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Wed, 20 Oct 2021 14:50:23 +0200
Subject: [PATCH] [CORRECT] Fix title reports for multiple detectors per run
 folder

---
 src/xfel_calibrate/calibrate.py | 2 ++
 src/xfel_calibrate/finalize.py  | 5 +----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/xfel_calibrate/calibrate.py b/src/xfel_calibrate/calibrate.py
index 64b2a5806..f165c37ff 100755
--- a/src/xfel_calibrate/calibrate.py
+++ b/src/xfel_calibrate/calibrate.py
@@ -1241,6 +1241,8 @@ def run():
     fmt_args = {'run_path': run_tmp_path,
                 'out_path': out_path,
                 'version': version,
+                'title': title,
+                'author': author,
                 'report_to': report_to,
                 'in_folder': folder,
                 'request_time': request_time,
diff --git a/src/xfel_calibrate/finalize.py b/src/xfel_calibrate/finalize.py
index 368306301..669272c86 100644
--- a/src/xfel_calibrate/finalize.py
+++ b/src/xfel_calibrate/finalize.py
@@ -393,7 +393,7 @@ def tex_escape(text):
     return regex.sub(lambda match: conv[match.group()], text)
 
 
-def finalize(joblist, finaljob, run_path, out_path, version, report_to, data_path='Unknown',
+def finalize(joblist, finaljob, run_path, out_path, version, title, author, report_to, data_path='Unknown',
              request_time='', submission_time=''):
     run_path = Path(run_path)
 
@@ -403,9 +403,6 @@ def finalize(joblist, finaljob, run_path, out_path, version, report_to, data_pat
     if finaljob:
         joblist.append(str(finaljob))
     metadata = cal_tools.tools.CalibrationMetadata(out_path)
-    nb_info = metadata.get('notebook', {})
-    title = nb_info.get('title', 'Unknown calibration')
-    author = nb_info.get('author', 'anonymous')
 
     job_time_fmt = 'JobID,Start,End,Elapsed,Suspended,State'.split(',')
     job_time_summary = get_job_info(joblist, job_time_fmt)
-- 
GitLab