diff options
-rw-r--r-- | src/argaze/AreaOfInterest/AOIFeatures.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/argaze/AreaOfInterest/AOIFeatures.py b/src/argaze/AreaOfInterest/AOIFeatures.py index 8bf546f..14d8166 100644 --- a/src/argaze/AreaOfInterest/AOIFeatures.py +++ b/src/argaze/AreaOfInterest/AOIFeatures.py @@ -199,16 +199,24 @@ class AOIScene(): return scene_copy +class AOISceneMissing(AOIScene, Exception): + """Exception to raise when aoi scene is missing.""" + + def __init__(self, message): + + super(Exception, self).__init__(message) + + self.dimension = 0 + self.areas = {} + class TimeStampedAOIScenes(DataStructures.TimeStampedBuffer): """Define timestamped buffer to store AOI scenes in time.""" def __setitem__(self, key, value): """Force value to inherit from AOIScene.""" + if type(value).__bases__[0] != AOIScene: raise ValueError(f'value must inherit from AOIScene') super().__setitem__(key, value) -class AOISceneMissing(Exception): - """Exception to raise when aoi scene can't be processed.""" - pass |