aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/GazeFeatures.py25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py
index d17d5b5..33b9ef8 100644
--- a/src/argaze/GazeFeatures.py
+++ b/src/argaze/GazeFeatures.py
@@ -367,7 +367,7 @@ class ScanStepError(Exception):
@dataclass(frozen=True)
class ScanStep():
- """Define a scan step as a pair of successive fixation and saccade.
+ """Define a scan step as a fixation and a consecutive saccade.
.. warning::
Scan step have to start by a fixation and then end by a saccade."""
@@ -413,7 +413,7 @@ class ScanPath(list):
self.__last_fixation = None
- def append_saccade(self, ts, saccade):
+ def append_saccade(self, ts, saccade) -> ScanStepType:
"""Append new saccade to scan path and return last new scan step if one have been created."""
# Ignore saccade if no fixation came before
@@ -435,27 +435,12 @@ class ScanPath(list):
# Clear last fixation
self.__last_fixation = None
- def append_fixation(self, ts, fixation) -> bool:
+ def append_fixation(self, ts, fixation):
"""Append new fixation to scan path.
-
.. warning::
- It could raise ScanStepError"""
-
- # No fixation came before
- if self.__last_fixation == None:
-
- self.__last_fixation = fixation
-
- # Merge successive fixations
- else:
-
- try:
- self.__last_fixation.merge(fixation)
-
- # Merge method not implemented for this kind of fixation
- except NotImplementedError as e:
+ Consecutives fixations are ignored keeping the last fixation"""
- print(e)
+ self.__last_fixation = fixation
def draw(self, frame, fixation_color=(255, 255, 255), saccade_color=(255, 255, 255), deepness=0):
"""Draw scan path into frame."""