From 0ef03baf16753f96a317e18ce62a8c7894fbf514 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 10 May 2023 07:57:25 +0200 Subject: Improving comments. --- src/argaze/GazeFeatures.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py index e17c9f9..7afb7ba 100644 --- a/src/argaze/GazeFeatures.py +++ b/src/argaze/GazeFeatures.py @@ -291,24 +291,24 @@ VisualScanStepType = TypeVar('VisualScanStep', bound="VisualScanStep") @dataclass(frozen=True) class VisualScanStep(): - """Define a visual scan step as a set of successive gaze movements onto a same AOI.""" + """Define a visual scan step as a set of successive gaze movements onto a same AOI. + .. warning:: + Last movement have to be a saccade that comes out AOI.""" movements: TimeStampedGazeMovements - """All movements over an aoi and the last saccade that comes out.""" + """All movements over an AOI and the last saccade that comes out.""" aoi: str = field(default='') - """Name of the looked AOI.""" + """AOI name.""" def __post_init__(self): - # Last movement should be a saccade - _, last_movement = self.movements.last - - assert(type(last_movement).__bases__[0] == Saccade) + # Last movement have to be a saccade + assert(type(self.transition).__bases__[0] == Saccade) @property def transition(self): - """Last saccade that comes out looked aoi""" + """Last saccade that comes out AOI.""" _, last_movement = self.movements.last return last_movement @@ -324,12 +324,12 @@ class VisualScan(list): self.__last_aoi = '' def __repr__(self): - """String representation""" + """String representation.""" return str(super()) def __str__(self) -> str: - """String display""" + """String display.""" output = '' @@ -340,12 +340,12 @@ class VisualScan(list): return output def append_saccade(self, ts, saccade): - """Append a new saccade to visual scan.""" + """Append new saccade to visual scan.""" self.__movements[ts] = saccade def append_fixation(self, ts, fixation, looked_aoi: str) -> bool: - """Append a new fixation to visual scan and return last new visual scan step if one have been created.""" + """Append new fixation to visual scan and return last new visual scan step if one have been created.""" # Is the fixation onto a new aoi? if looked_aoi != self.__last_aoi and len(self.__movements) > 0: -- cgit v1.1