diff options
-rw-r--r-- | src/argaze/GazeFeatures.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py index 7f292ee..3daea8f 100644 --- a/src/argaze/GazeFeatures.py +++ b/src/argaze/GazeFeatures.py @@ -292,10 +292,12 @@ VisualScanStepType = TypeVar('VisualScanStep', bound="VisualScanStep") class VisualScanStepError(Exception): """Exception raised at VisualScanStepError creation if a visual scan step doesn't start by a fixation or doesn't end by a saccade.""" - def __init__(self, message): + def __init__(self, message, aoi=''): super().__init__(message) + self.aoi = aoi + @dataclass(frozen=True) class VisualScanStep(): """Define a visual scan step as a set of successive gaze movements onto a same AOI. @@ -316,12 +318,12 @@ class VisualScanStep(): # First movement have to be a fixation if type(self.first_fixation).__bases__[0] != Fixation: - raise VisualScanStepError('First step movement is not a fixation') + raise VisualScanStepError('First step movement is not a fixation', self.aoi) # Last movement have to be a saccade if type(self.last_saccade).__bases__[0] != Saccade: - raise VisualScanStepError('Last step movement is not a saccade') + raise VisualScanStepError('Last step movement is not a saccade', self.aoi) @property def first_fixation(self): |