diff options
author | Théo de la Hogue | 2022-09-20 17:24:28 +0200 |
---|---|---|
committer | Théo de la Hogue | 2022-09-20 17:24:28 +0200 |
commit | 198131d325ca874740de9535101f578704f7f61e (patch) | |
tree | 860ef28b8fafd3c199768d0626eccca0bcdbb1c5 /src | |
parent | 3cd303dd0255b981536aff3c13da5a791a8d0b9b (diff) | |
download | argaze-198131d325ca874740de9535101f578704f7f61e.zip argaze-198131d325ca874740de9535101f578704f7f61e.tar.gz argaze-198131d325ca874740de9535101f578704f7f61e.tar.bz2 argaze-198131d325ca874740de9535101f578704f7f61e.tar.xz |
Defining AOISceneMissing as a AOIScen and an Exception.
Diffstat (limited to 'src')
-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 |