From fdb7bee02340484e014ed67e93d7f501ce302426 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver <thomas.kluyver@xfel.eu> Date: Mon, 16 Aug 2021 11:51:43 +0200 Subject: [PATCH] Clearer error message when JUNGFRAU dark notebook finds no suitable files --- .../Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb index 31fb1d431..9c2c7086b 100644 --- a/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb +++ b/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb @@ -201,7 +201,11 @@ " fp_name = path_template.format(r_n, karabo_da_control)\n", " fp_path = '{}/{}'.format(ped_dir, fp_name)\n", " \n", - " n_files = len(glob.glob(\"{}/*{}*.h5\".format(ped_dir, path_inset)))\n", + " files_pattern = \"{}/*{}*.h5\".format(ped_dir, path_inset)\n", + " n_files = len(glob.glob(files_pattern))\n", + " if n_files == 0:\n", + " raise Exception(f\"No files found matching {files_pattern!r}\")\n", + "\n", " myRange = range(0, n_files)\n", " control_path = h5path_cntrl.format(karabo_id_control, receiver_control_id)\n", " \n", -- GitLab