From 6a77674c4c7b0589ffa7b13edbbde41c371b3d4f Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 10 May 2023 11:59:58 +0200 Subject: Fixing VisualScanStep duration attribute. --- src/argaze/GazeFeatures.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py index 1129849..2510cb2 100644 --- a/src/argaze/GazeFeatures.py +++ b/src/argaze/GazeFeatures.py @@ -316,12 +316,12 @@ class VisualScanStep(): def __post_init__(self): # First movement have to be a fixation - if type(self.first_fixation).__bases__[0] != Fixation: + if type(self.first_fixation).__bases__[0] != Fixation and type(self.first_fixation) != 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: + if type(self.last_saccade).__bases__[0] != Saccade and type(self.last_saccade) != Saccade: raise VisualScanStepError('Last step movement is not a saccade', self.aoi) @@ -344,10 +344,10 @@ class VisualScanStep(): """Time spent on AOI.""" # Timestamp of first position of first fixation - first_ts, _ = self.movements.first.positions.first + first_ts, _ = self.first_fixation.positions.first # Timestamp of first position of last saccade - last_ts, _ = self.movements.last.positions.first + last_ts, _ = self.last_saccade.positions.first return last_ts - first_ts @@ -400,7 +400,7 @@ class VisualScanPath(list): try: # Edit new step - new_step = VisualScanStep(self.__movements, looked_aoi) + new_step = VisualScanStep(self.__movements, self.__last_aoi) # Append new step super().append(new_step) -- cgit v1.1