aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-07-06 16:01:29 +0200
committerThéo de la Hogue2023-07-06 16:01:29 +0200
commit877a09fae3ca42e12dfa670441d61297a3405760 (patch)
tree25d3c53e549f65f80076893c2ff5533df698df8f /src
parenta51632ea7a8ef39b357dee88fb7e8246cce24f4e (diff)
downloadargaze-877a09fae3ca42e12dfa670441d61297a3405760.zip
argaze-877a09fae3ca42e12dfa670441d61297a3405760.tar.gz
argaze-877a09fae3ca42e12dfa670441d61297a3405760.tar.bz2
argaze-877a09fae3ca42e12dfa670441d61297a3405760.tar.xz
Use finish method inline.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/GazeAnalysis/DispersionThresholdIdentification.py15
-rw-r--r--src/argaze/GazeAnalysis/VelocityThresholdIdentification.py15
2 files changed, 6 insertions, 24 deletions
diff --git a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py
index 42450e5..350a940 100644
--- a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py
+++ b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py
@@ -134,10 +134,7 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
if (ts - ts_last) > self.duration_min_threshold:
# Get last movement
- last_movement = self.current_saccade if len(self.__fixation_positions) == 0 else self.current_fixation
-
- # Set last movement as finished
- last_movement.finish()
+ last_movement = self.current_saccade.finish() if len(self.__fixation_positions) == 0 else self.current_fixation.finish()
# Clear all former gaze positions
self.__valid_positions = GazeFeatures.TimeStampedGazePositions()
@@ -166,10 +163,7 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
if deviation <= self.deviation_max_threshold:
# Store last saccade
- last_saccade = self.current_saccade
-
- # Set last saccade as finished
- last_saccade.finish()
+ last_saccade = self.current_saccade.finish()
# Clear saccade positions
self.__saccade_positions = GazeFeatures.TimeStampedGazePositions()
@@ -184,10 +178,7 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
elif len(self.__fixation_positions) > 0:
# Store last fixation
- last_fixation = self.current_fixation
-
- # Set last fixation as finished
- last_fixation.finish()
+ last_fixation = self.current_fixation.finish()
# Start saccade positions with current gaze position
self.__saccade_positions[ts] = gaze_position
diff --git a/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py b/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py
index c00a778..7405ec6 100644
--- a/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py
+++ b/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py
@@ -151,10 +151,7 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
self.__last_position = gaze_position
# Get last movement
- last_movement = self.current_saccade if len(self.__fixation_positions) == 0 else self.current_fixation
-
- # Set last movement as finished
- last_movement.finish()
+ last_movement = self.current_saccade.finish() if len(self.__fixation_positions) == 0 else self.current_fixation.finish()
# Clear all former gaze positions
self.__fixation_positions = GazeFeatures.TimeStampedGazePositions()
@@ -180,10 +177,7 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
if len(self.__fixation_positions) > 0:
# Create last fixation
- last_fixation = Fixation(self.__fixation_positions)
-
- # Set last fixation as finished
- last_fixation.finish()
+ last_fixation = Fixation(self.__fixation_positions).finish()
# Clear fixation positions
self.__fixation_positions = GazeFeatures.TimeStampedGazePositions()
@@ -206,10 +200,7 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
if len(self.__saccade_positions) > 0:
# Create last saccade
- last_saccade = Saccade(self.__saccade_positions)
-
- # Set last saccade as finished
- last_saccade.finish()
+ last_saccade = Saccade(self.__saccade_positions).finish()
# Clear fixation positions
self.__saccade_positions = GazeFeatures.TimeStampedGazePositions()