From 0f9ab55a50c1442460a2ef6e34ff77fae356c05c Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 10 May 2023 16:11:08 +0200 Subject: Renaming last aoi into current aoi. --- src/argaze/GazeFeatures.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py index 95d90e1..d6011a0 100644 --- a/src/argaze/GazeFeatures.py +++ b/src/argaze/GazeFeatures.py @@ -376,14 +376,14 @@ VisualScanPathType = TypeVar('VisualScanPathType', bound="VisualScanPathType") # Type definition for type annotation convenience class VisualScanPath(list): - """List of visual scan steps over successive aoi.""" + """List of visual scan steps over successive AOI.""" def __init__(self): super().__init__() self.__movements = TimeStampedGazeMovements() - self.__last_aoi = '' + self.__current_aoi = '' def __repr__(self): """String representation.""" @@ -399,8 +399,16 @@ class VisualScanPath(list): output += f'> {step.aoi} ' + output += f'> {self.__current_aoi}' + return output - + + @property + def current_aoi(self): + """AOI name of visual scan step under construction""" + + return self.__current_aoi + def append_saccade(self, ts, saccade): """Append new saccade to visual scan path.""" @@ -416,12 +424,12 @@ class VisualScanPath(list): It could raise VisualScanStepError""" # Is it fixation onto a new aoi? - if looked_aoi != self.__last_aoi and len(self.__movements) > 0: + if looked_aoi != self.__current_aoi and len(self.__movements) > 0: try: # Edit new step - new_step = VisualScanStep(self.__movements, self.__last_aoi) + new_step = VisualScanStep(self.__movements, self.__current_aoi) # Append new step super().append(new_step) @@ -438,14 +446,14 @@ class VisualScanPath(list): self.__movements[ts] = fixation # Remember new aoi - self.__last_aoi = looked_aoi + self.__current_aoi = looked_aoi else: # Append new fixation self.__movements[ts] = fixation # Remember aoi - self.__last_aoi = looked_aoi + self.__current_aoi = looked_aoi return None -- cgit v1.1