aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
diff options
context:
space:
mode:
authorThéo de la Hogue2024-02-29 11:09:32 +0100
committerThéo de la Hogue2024-02-29 11:09:32 +0100
commit1a3aac125980019ae86493782795569327bc8eaa (patch)
tree0ae2c4a9fb57e51b0a510f63b9503648f41642d3 /src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
parentfaa6d8acf3c9e4d11a3ee84df2d5a48501befd68 (diff)
downloadargaze-1a3aac125980019ae86493782795569327bc8eaa.zip
argaze-1a3aac125980019ae86493782795569327bc8eaa.tar.gz
argaze-1a3aac125980019ae86493782795569327bc8eaa.tar.bz2
argaze-1a3aac125980019ae86493782795569327bc8eaa.tar.xz
Fixing VelocityThresholdIdentification tests.
Diffstat (limited to 'src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py')
-rw-r--r--src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py b/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
index 07496c3..156f6f1 100644
--- a/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
+++ b/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
@@ -359,13 +359,10 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
gaze_movement_identifier = DispersionThresholdIdentification.GazeMovementIdentifier(deviation_max_threshold=deviation_max, duration_min_threshold=max_time*2)
- # Get last ts to terminate identification on last gaze position
- last_ts = ts_gaze_positions[-1].timestamp
-
# Iterate on gaze positions
for gaze_position in ts_gaze_positions:
- finished_gaze_movement = gaze_movement_identifier.identify(gaze_position.timestamp, gaze_position, terminate=(gaze_position.timestamp == last_ts))
+ finished_gaze_movement = gaze_movement_identifier.identify(gaze_position.timestamp, gaze_position, terminate=(gaze_position.timestamp == ts_gaze_positions[-1].timestamp))
if GazeFeatures.is_fixation(finished_gaze_movement):
@@ -382,13 +379,6 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertLessEqual(finished_gaze_movement.duration, max_time)
self.assertLessEqual(finished_gaze_movement.finished, True)
- # Check that last gaze position date is not equal to given gaze position date
- if finished_gaze_movement:
-
- last_ts = finished_gaze_movement[-1].timestamp
-
- self.assertNotEqual(last_ts, gaze_position.timestamp)
-
# Check that last gaze position date of current fixation is equal to given gaze position date
# NOTE: This is not true for saccade as, for I-DT, there is a minimal time window while the gaze movement is unknown
current_gaze_movement = gaze_movement_identifier.current_gaze_movement
@@ -396,9 +386,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
if GazeFeatures.is_fixation(current_gaze_movement):
- last_ts = current_gaze_movement[-1].timestamp
-
- self.assertEqual(last_ts, gaze_position.timestamp)
+ self.assertEqual(current_gaze_movement[-1].timestamp, gaze_position.timestamp)
def test_identification_generator(self):
"""Test DispersionThresholdIdentification identification using generator."""