From b400b67ad3413fab76d8fba26c950bc1e56645c0 Mon Sep 17 00:00:00 2001 From: Amir MOHAMMADI <amir.mohammadi@idiap.ch> Date: Thu, 24 Mar 2022 18:12:17 +0100 Subject: [PATCH] Fix a deprecation warning and add better assert messages --- bob/io/base/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bob/io/base/__init__.py b/bob/io/base/__init__.py index 87e5213..dbe34b9 100644 --- a/bob/io/base/__init__.py +++ b/bob/io/base/__init__.py @@ -137,7 +137,7 @@ def load(inputs): The data loaded from the given ``inputs``. """ - from collections import Iterable + from collections.abc import Iterable import numpy if _is_string(inputs): if not os.path.exists(inputs): @@ -401,9 +401,9 @@ def _generate_features(reader, paths, same_size=False): else: # make sure all features have the same shape and dtype if same_size: - assert shape == list(feature.shape) + assert shape == list(feature.shape), f"Expected feature shape of {shape}, got {feature.shape}" else: - assert shape[1:] == list(feature.shape[1:]) + assert shape[1:] == list(feature.shape[1:]), f"Ignoring first dimension, expected feature shape of {shape}, got {feature.shape}" assert dtype == feature.dtype if same_size: -- GitLab