From 37e67e516823e1c0424f2e0608cc8321b30e7bb1 Mon Sep 17 00:00:00 2001 From: Dingel321 Date: Thu, 18 Jul 2024 17:13:11 +0200 Subject: [PATCH] fixed bug for loading index map --- src/cryo_sbi/utils/image_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cryo_sbi/utils/image_utils.py b/src/cryo_sbi/utils/image_utils.py index b16595e..dc8ca14 100644 --- a/src/cryo_sbi/utils/image_utils.py +++ b/src/cryo_sbi/utils/image_utils.py @@ -423,7 +423,9 @@ def load_index_map(self, path: str): path (str): Path to load the index map. """ index_map = np.load(path) - assert self.paths == index_map["paths"], "Paths do not match the index map." + assert len(self.paths) == len(index_map["paths"]), "Number of paths do not match the index map." + for path1, path2 in zip(self.paths, index_map["paths"]): + assert path1 == path2, "Paths do not match the index map." self._path_index = index_map["path_index"] self._file_index = index_map["file_index"] self._index_map = True