From b3b58d6f030e6e4e7aaa67e6031dceea6a6c4bb6 Mon Sep 17 00:00:00 2001 From: Andrew Davison Date: Tue, 30 Jan 2024 15:41:08 +0100 Subject: [PATCH] replace assert with a TypeError in RegionOfInterest --- neo/core/regionofinterest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neo/core/regionofinterest.py b/neo/core/regionofinterest.py index 3de9b624f..da7ed0409 100644 --- a/neo/core/regionofinterest.py +++ b/neo/core/regionofinterest.py @@ -28,7 +28,8 @@ def _get_obj(self): return self.image_sequence def _set_obj(self, value): - assert isinstance(value, ImageSequence) + if not isinstance(value, ImageSequence): + raise TypeError(f"Value must be ImageSequence, not of type: {type(value)}") self.image_sequence = value obj = property(fget=_get_obj, fset=_set_obj)