From 6b55d1df7f7dd8eb48ee280bc8ef3076be251738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=BCmmmerer?= Date: Sun, 10 Mar 2024 20:33:32 +0100 Subject: [PATCH] Better error message in HDF5 models MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthias Kümmmerer --- pysaliency/precomputed_models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pysaliency/precomputed_models.py b/pysaliency/precomputed_models.py index e6ab5b8..c07f47f 100644 --- a/pysaliency/precomputed_models.py +++ b/pysaliency/precomputed_models.py @@ -36,7 +36,15 @@ def get_keys_from_filenames(filenames, keys): if remaining_filename in keys: break else: - raise ValueError('No common prefix found from {}'.format(filenames[0])) + print("No common prefix found!") + print(f" filename: {filenames[0]}") + print(" keys:") + for key in keys[:5]: + print(f" {key}") + for key in keys[-5:]: + print(f" {key}") + + raise ValueError('No common prefix found!') filename_keys = [] for filename in filenames: