aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
diff options
context:
space:
mode:
authorThéo de la Hogue2023-07-06 15:50:31 +0200
committerThéo de la Hogue2023-07-06 15:50:31 +0200
commit717452611747ab98a5e94c1f90afcc2854923c68 (patch)
tree9e03e7d6ede09b1436a9b25957b2def4ae8ed946 /src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
parentce43c0e9f100aa0eaec2f39a258e92ffc5cc44a8 (diff)
downloadargaze-717452611747ab98a5e94c1f90afcc2854923c68.zip
argaze-717452611747ab98a5e94c1f90afcc2854923c68.tar.gz
argaze-717452611747ab98a5e94c1f90afcc2854923c68.tar.bz2
argaze-717452611747ab98a5e94c1f90afcc2854923c68.tar.xz
Adding and testing finished attribute to GazeMovement class.
Diffstat (limited to 'src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py')
-rw-r--r--src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py b/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
index eba80c8..f1d02d6 100644
--- a/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
+++ b/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py
@@ -120,6 +120,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertLessEqual(fixation.deviation_max, deviation_max)
self.assertGreaterEqual(fixation.duration, size * min_time)
self.assertLessEqual(fixation.duration, size * max_time)
+ self.assertLessEqual(fixation.finished, True)
def test_fixation_and_direct_saccade_identification(self):
"""Test DispersionThresholdIdentification fixation and saccade identification."""
@@ -151,6 +152,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertLessEqual(fixation.deviation_max, deviation_max)
self.assertGreaterEqual(fixation.duration, size * min_time)
self.assertLessEqual(fixation.duration, size * max_time)
+ self.assertLessEqual(fixation.finished, True)
# Check first saccade
ts, saccade = ts_saccades.pop_first()
@@ -158,6 +160,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertEqual(len(saccade.positions.keys()), 1)
self.assertGreaterEqual(saccade.duration, 0.)
self.assertLessEqual(saccade.duration, 0.)
+ self.assertLessEqual(saccade.finished, True)
# Check second fixation
ts, fixation = ts_fixations.pop_first()
@@ -166,6 +169,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertLessEqual(fixation.deviation_max, deviation_max)
self.assertGreaterEqual(fixation.duration, size * min_time)
self.assertLessEqual(fixation.duration, size * max_time)
+ self.assertLessEqual(fixation.finished, True)
def test_fixation_and_short_saccade_identification(self):
"""Test DispersionThresholdIdentification fixation and saccade identification."""
@@ -200,6 +204,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertLessEqual(fixation.deviation_max, deviation_max)
self.assertGreaterEqual(fixation.duration, size * min_time)
self.assertLessEqual(fixation.duration, size * max_time)
+ self.assertLessEqual(fixation.finished, True)
# Check first saccade
ts, saccade = ts_saccades.pop_first()
@@ -207,6 +212,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertEqual(len(saccade.positions.keys()), move)
self.assertGreaterEqual(saccade.duration, min_time)
self.assertLessEqual(saccade.duration, max_time)
+ self.assertLessEqual(saccade.finished, True)
# Check second fixation
ts, fixation = ts_fixations.pop_first()
@@ -215,6 +221,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertLessEqual(fixation.deviation_max, deviation_max)
self.assertGreaterEqual(fixation.duration, size * min_time)
self.assertLessEqual(fixation.duration, size * max_time)
+ self.assertLessEqual(fixation.finished, True)
def test_invalid_gaze_position(self):
"""Test DispersionThresholdIdentification fixation and saccade identification with invalid gaze position."""
@@ -243,14 +250,16 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertLessEqual(fixation.deviation_max, deviation_max)
self.assertGreaterEqual(fixation.duration, 7 * min_time)
self.assertLessEqual(fixation.duration, 7 * max_time)
+ self.assertLessEqual(fixation.finished, True)
- # Check seconde fixation
+ # Check second fixation
ts, fixation = ts_fixations.pop_first()
self.assertEqual(len(fixation.positions.keys()), 5)
self.assertLessEqual(fixation.deviation_max, deviation_max)
self.assertGreaterEqual(fixation.duration, 5 * min_time)
self.assertLessEqual(fixation.duration, 5 * max_time)
+ self.assertLessEqual(fixation.finished, True)
def test_fixation_overlapping(self):
"""Test Fixation overlap function."""
@@ -310,6 +319,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
#self.assertGreaterEqual(fixation.deviation_max, deviation_max)
self.assertGreaterEqual(fixation.duration, 2 * size * min_time)
self.assertLessEqual(fixation.duration, 2 * size * max_time)
+ self.assertLessEqual(fixation.finished, True)
def test_identification_generator(self):
"""Test DispersionThresholdIdentification identification using generator."""
@@ -338,6 +348,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertLessEqual(gaze_movement.deviation_max, deviation_max)
self.assertGreaterEqual(gaze_movement.duration, size * min_time)
self.assertLessEqual(gaze_movement.duration, size * max_time)
+ self.assertLessEqual(gaze_movement.finished, True)
fixation_count += 1
@@ -346,6 +357,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase):
self.assertEqual(len(gaze_movement.positions.keys()), 1)
self.assertGreaterEqual(gaze_movement.duration, 0.)
self.assertLessEqual(gaze_movement.duration, 0.)
+ self.assertLessEqual(gaze_movement.finished, True)
if __name__ == '__main__':