aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-05-10 07:57:25 +0200
committerThéo de la Hogue2023-05-10 07:57:25 +0200
commit0ef03baf16753f96a317e18ce62a8c7894fbf514 (patch)
treefa4c3d61e288405985a22b51f5b362762a9ab3f9
parent537a4b92c48891eef1748df5e1937f924f0584b3 (diff)
downloadargaze-0ef03baf16753f96a317e18ce62a8c7894fbf514.zip
argaze-0ef03baf16753f96a317e18ce62a8c7894fbf514.tar.gz
argaze-0ef03baf16753f96a317e18ce62a8c7894fbf514.tar.bz2
argaze-0ef03baf16753f96a317e18ce62a8c7894fbf514.tar.xz
Improving comments.
-rw-r--r--src/argaze/GazeFeatures.py24
1 files changed, 12 insertions, 12 deletions
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: