diff options
Diffstat (limited to 'src/argaze.test')
-rw-r--r-- | src/argaze.test/AreaOfInterest/AOIFeatures.py | 10 | ||||
-rw-r--r-- | src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py | 28 | ||||
-rw-r--r-- | src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py | 18 | ||||
-rw-r--r-- | src/argaze.test/GazeFeatures.py | 12 |
4 files changed, 34 insertions, 34 deletions
diff --git a/src/argaze.test/AreaOfInterest/AOIFeatures.py b/src/argaze.test/AreaOfInterest/AOIFeatures.py index cb8fb52..baebadf 100644 --- a/src/argaze.test/AreaOfInterest/AOIFeatures.py +++ b/src/argaze.test/AreaOfInterest/AOIFeatures.py @@ -23,12 +23,12 @@ class TestAreaOfInterestClass(unittest.TestCase): # Check that 0D AreaOfInterest creation is considered as empty aoi_0D = AOIFeatures.AreaOfInterest() - self.assertTrue(aoi_0D.empty) + self.assertTrue(aoi_0D.is_empty()) # Check 1 point 1D AreaOfInterest creation aoi_1D = AOIFeatures.AreaOfInterest([[0]]) - self.assertFalse(aoi_1D.empty) + self.assertFalse(aoi_1D.is_empty()) self.assertEqual(aoi_1D.dimension, 1) self.assertEqual(aoi_1D.points_number, 1) self.assertIsNone(numpy.testing.assert_array_equal(aoi_1D.bounds, [[0], [0]])) @@ -41,7 +41,7 @@ class TestAreaOfInterestClass(unittest.TestCase): # Check 2 points 1D AreaOfInterest creation aoi_1D = AOIFeatures.AreaOfInterest([[0], [1]]) - self.assertFalse(aoi_1D.empty) + self.assertFalse(aoi_1D.is_empty()) self.assertEqual(aoi_1D.dimension, 1) self.assertEqual(aoi_1D.points_number, 2) self.assertIsNone(numpy.testing.assert_array_equal(aoi_1D.bounds, [[0], [1]])) @@ -54,7 +54,7 @@ class TestAreaOfInterestClass(unittest.TestCase): # Check 4 points 2D AreaOfInterest creation aoi_2D = AOIFeatures.AreaOfInterest([[0, 0], [0, 1], [1, 0], [1, 1]]) - self.assertFalse(aoi_2D.empty) + self.assertFalse(aoi_2D.is_empty()) self.assertEqual(aoi_2D.dimension, 2) self.assertEqual(aoi_2D.points_number, 4) self.assertIsNone(numpy.testing.assert_array_equal(aoi_2D.bounds, [[0, 0], [1, 1]])) @@ -66,7 +66,7 @@ class TestAreaOfInterestClass(unittest.TestCase): # Check 8 points 3D AreaOfInterest creation aoi_3D = AOIFeatures.AreaOfInterest([[0, 0, 0], [0, 1, 0], [1, 0, 0], [1, 1, 0], [0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]]) - self.assertFalse(aoi_3D.empty) + self.assertFalse(aoi_3D.is_empty()) self.assertEqual(aoi_3D.dimension, 3) self.assertEqual(aoi_3D.points_number, 8) self.assertIsNone(numpy.testing.assert_array_equal(aoi_3D.bounds, [[0, 0, 0], [1, 1, 1]])) diff --git a/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py b/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py index 156f6f1..0bb8ed7 100644 --- a/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py +++ b/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py @@ -125,7 +125,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertLessEqual(fixation.deviation_max, deviation_max) self.assertGreaterEqual(fixation.duration, (size - 1) * min_time) self.assertLessEqual(fixation.duration, (size - 1) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) def test_fixation_and_direct_saccade_identification(self): """Test DispersionThresholdIdentification fixation and saccade identification.""" @@ -157,7 +157,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertLessEqual(fixation.deviation_max, deviation_max) self.assertGreaterEqual(fixation.duration, (size - 1) * min_time) self.assertLessEqual(fixation.duration, (size - 1) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check first saccade saccade = ts_saccades.pop(0) @@ -165,7 +165,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(saccade), 2) self.assertGreaterEqual(saccade.duration, min_time) self.assertLessEqual(saccade.duration, max_time) - self.assertLessEqual(saccade.finished, True) + self.assertLessEqual(saccade.is_finished(), True) # Check that last position of a movement is equal to first position of next movement self.assertEqual(fixation[-1].timestamp, saccade[0].timestamp) @@ -178,7 +178,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertLessEqual(fixation.deviation_max, deviation_max) self.assertGreaterEqual(fixation.duration, (size - 1) * min_time) self.assertLessEqual(fixation.duration, (size - 1) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check that last position of a movement is equal to first position of next movement self.assertEqual(saccade[-1].timestamp, fixation[0].timestamp) @@ -217,7 +217,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertLessEqual(fixation.deviation_max, deviation_max) self.assertGreaterEqual(fixation.duration, (size - 1) * min_time) self.assertLessEqual(fixation.duration, (size - 1) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check first saccade saccade = ts_saccades.pop(0) @@ -225,7 +225,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(saccade), move + 2) self.assertGreaterEqual(saccade.duration, (move + 1) * min_time) self.assertLessEqual(saccade.duration, (move + 1) * max_time) - self.assertLessEqual(saccade.finished, True) + self.assertLessEqual(saccade.is_finished(), True) # Check that last position of a movement is equal to first position of next movement self.assertEqual(fixation[-1].timestamp, saccade[0].timestamp) @@ -238,7 +238,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertLessEqual(fixation.deviation_max, deviation_max) self.assertGreaterEqual(fixation.duration, (size - 1) * min_time) self.assertLessEqual(fixation.duration, (size - 1) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check that last position of a movement is equal to first position of next movement self.assertEqual(saccade[-1].timestamp, fixation[0].timestamp) @@ -271,7 +271,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertLessEqual(fixation.deviation_max, deviation_max) self.assertGreaterEqual(fixation.duration, 6 * min_time) self.assertLessEqual(fixation.duration, 6 * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check second fixation fixation = ts_fixations.pop(0) @@ -280,7 +280,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertLessEqual(fixation.deviation_max, deviation_max) self.assertGreaterEqual(fixation.duration, 4 * min_time) self.assertLessEqual(fixation.duration, 4 * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) def test_fixation_overlapping(self): """Test Fixation overlap function.""" @@ -340,7 +340,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): #self.assertGreaterEqual(fixation.deviation_max, deviation_max) self.assertGreaterEqual(fixation.duration, (2 * size - 1) * min_time) self.assertLessEqual(fixation.duration, (2 * size - 1) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) def test_identification_browsing(self): """Test DispersionThresholdIdentification identification browsing.""" @@ -370,14 +370,14 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertLessEqual(finished_gaze_movement.deviation_max, deviation_max) self.assertGreaterEqual(finished_gaze_movement.duration, (size-1) * min_time) self.assertLessEqual(finished_gaze_movement.duration, (size-1) * max_time) - self.assertLessEqual(finished_gaze_movement.finished, True) + self.assertLessEqual(finished_gaze_movement.is_finished(), True) elif GazeFeatures.is_saccade(finished_gaze_movement): self.assertEqual(len(finished_gaze_movement), 2) self.assertGreaterEqual(finished_gaze_movement.duration, min_time) self.assertLessEqual(finished_gaze_movement.duration, max_time) - self.assertLessEqual(finished_gaze_movement.finished, True) + self.assertLessEqual(finished_gaze_movement.is_finished(), True) # 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 @@ -413,14 +413,14 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): self.assertLessEqual(finished_gaze_movement.deviation_max, deviation_max) self.assertGreaterEqual(finished_gaze_movement.duration, size * min_time) self.assertLessEqual(finished_gaze_movement.duration, size * max_time) - self.assertLessEqual(finished_gaze_movement.finished, True) + self.assertLessEqual(finished_gaze_movement.is_finished(), True) elif GazeFeatures.is_saccade(finished_gaze_movement): self.assertEqual(len(finished_gaze_movement), 2) self.assertGreaterEqual(finished_gaze_movement.duration, 2 * min_time) self.assertLessEqual(finished_gaze_movement.duration, 2 * max_time) - self.assertLessEqual(finished_gaze_movement.finished, True) + self.assertLessEqual(finished_gaze_movement.is_finished(), True) if __name__ == '__main__': diff --git a/src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py b/src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py index 262cfc0..1c7f7e3 100644 --- a/src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py +++ b/src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py @@ -125,7 +125,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(fixation), size - 1) self.assertGreaterEqual(fixation.duration, (size - 2) * min_time) self.assertLessEqual(fixation.duration, (size - 2) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) def test_fixation_and_direct_saccade_identification(self): """Test VelocityThresholdIdentification fixation and saccade identification.""" @@ -157,7 +157,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(fixation), size - 1) self.assertGreaterEqual(fixation.duration, (size - 2) * min_time) self.assertLessEqual(fixation.duration, (size - 2) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check first saccade saccade = ts_saccades.pop(0) @@ -165,7 +165,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(saccade), 2) self.assertGreaterEqual(saccade.duration, min_time) self.assertLessEqual(saccade.duration, max_time) - self.assertLessEqual(saccade.finished, True) + self.assertLessEqual(saccade.is_finished(), True) # Check that last position of a movement is equal to first position of next movement self.assertEqual(fixation[-1].timestamp, saccade[0].timestamp) @@ -177,7 +177,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(fixation), size) self.assertGreaterEqual(fixation.duration, (size - 1) * min_time) self.assertLessEqual(fixation.duration, (size - 1) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check that last position of a movement is equal to first position of next movement self.assertEqual(saccade[-1].timestamp, fixation[0].timestamp) @@ -216,7 +216,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(fixation), size - 1) # BUG: NOT ALWAYS TRUE !!! self.assertGreaterEqual(fixation.duration, (size - 2) * min_time) self.assertLessEqual(fixation.duration, (size - 2) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check first saccade saccade = ts_saccades.pop(0) @@ -224,7 +224,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(saccade), move + 2) self.assertGreaterEqual(saccade.duration, (move + 1) * min_time) self.assertLessEqual(saccade.duration, (move + 1) * max_time) - self.assertLessEqual(saccade.finished, True) + self.assertLessEqual(saccade.is_finished(), True) # Check that last position of a movement is equal to first position of next movement self.assertEqual(fixation[-1].timestamp, saccade[0].timestamp) @@ -236,7 +236,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(fixation), size) self.assertGreaterEqual(fixation.duration, (size - 1) * min_time) self.assertLessEqual(fixation.duration, (size - 1) * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check that last position of a movement is equal to first position of next movement self.assertEqual(saccade[-1], fixation[0]) @@ -269,7 +269,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(fixation), 6) self.assertGreaterEqual(fixation.duration, 5 * min_time) self.assertLessEqual(fixation.duration, 5 * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) # Check second fixation fixation = ts_fixations.pop(0) @@ -277,7 +277,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): self.assertEqual(len(fixation), 4) self.assertGreaterEqual(fixation.duration, 3 * min_time) self.assertLessEqual(fixation.duration, 3 * max_time) - self.assertLessEqual(fixation.finished, True) + self.assertLessEqual(fixation.is_finished(), True) def test_identification_browsing(self): """Test VelocityThresholdIdentification identification browsing.""" diff --git a/src/argaze.test/GazeFeatures.py b/src/argaze.test/GazeFeatures.py index 035c76a..2d052ab 100644 --- a/src/argaze.test/GazeFeatures.py +++ b/src/argaze.test/GazeFeatures.py @@ -321,7 +321,7 @@ class TestGazeMovementClass(unittest.TestCase): self.assertEqual(abstract_gaze_movement.duration, 0) self.assertEqual(abstract_gaze_movement.amplitude, 0) self.assertEqual(bool(abstract_gaze_movement), False) - self.assertEqual(abstract_gaze_movement.finished, False) + self.assertEqual(abstract_gaze_movement.is_finished(), False) def test_finish(self): """Test GazeMovement finishing.""" @@ -331,15 +331,15 @@ class TestGazeMovementClass(unittest.TestCase): abstract_gaze_movement_ref = abstract_gaze_movement # Check abstract GazeMovement and its reference - self.assertEqual(abstract_gaze_movement.finished, False) - self.assertEqual(abstract_gaze_movement_ref.finished, False) + self.assertEqual(abstract_gaze_movement.is_finished(), False) + self.assertEqual(abstract_gaze_movement_ref.is_finished(), False) # Set gaze movement as finished abstract_gaze_movement.finish() # Check abstract GazeMovement and its reference - self.assertEqual(abstract_gaze_movement.finished, True) - self.assertEqual(abstract_gaze_movement_ref.finished, True) + self.assertEqual(abstract_gaze_movement.is_finished(), True) + self.assertEqual(abstract_gaze_movement_ref.is_finished(), True) def test_message(self): """Test GazeMovement creation with message only.""" @@ -351,7 +351,7 @@ class TestGazeMovementClass(unittest.TestCase): self.assertEqual(gaze_movement.duration, 0) self.assertEqual(gaze_movement.amplitude, 0) self.assertEqual(bool(gaze_movement), False) - self.assertEqual(gaze_movement.finished, False) + self.assertEqual(gaze_movement.is_finished(), False) self.assertEqual(gaze_movement.message, 'test') class TestScanStepClass(unittest.TestCase): |