aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-05-10 11:59:58 +0200
committerThéo de la Hogue2023-05-10 11:59:58 +0200
commit6a77674c4c7b0589ffa7b13edbbde41c371b3d4f (patch)
tree44fe5231d0ab327e7e167737a576d7cc3368e073
parent478d4e6c122fd7698fb657b798f3609c49fbf435 (diff)
downloadargaze-6a77674c4c7b0589ffa7b13edbbde41c371b3d4f.zip
argaze-6a77674c4c7b0589ffa7b13edbbde41c371b3d4f.tar.gz
argaze-6a77674c4c7b0589ffa7b13edbbde41c371b3d4f.tar.bz2
argaze-6a77674c4c7b0589ffa7b13edbbde41c371b3d4f.tar.xz
Fixing VisualScanStep duration attribute.
-rw-r--r--src/argaze/GazeFeatures.py10
1 files changed, 5 insertions, 5 deletions
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)