From 54ac7fccd108ab185514def2e289e2d90597f46f Mon Sep 17 00:00:00 2001 From: matthias-k Date: Thu, 14 Mar 2024 13:56:13 +0100 Subject: [PATCH] Better error message in HDF5 models (#56) 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: