diff options
author | Théo de la Hogue | 2023-05-09 14:25:46 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-05-09 14:25:46 +0200 |
commit | 86a43e8af7d70302937e27da181198f3ddab5eed (patch) | |
tree | cadc0b99c56f56d78767740defc555ad8335c358 /src/argaze.test | |
parent | f65a712b8b1cf8ec942a8fa7b7e3b3719de09f7f (diff) | |
download | argaze-86a43e8af7d70302937e27da181198f3ddab5eed.zip argaze-86a43e8af7d70302937e27da181198f3ddab5eed.tar.gz argaze-86a43e8af7d70302937e27da181198f3ddab5eed.tar.bz2 argaze-86a43e8af7d70302937e27da181198f3ddab5eed.tar.xz |
Changing raycast and circlecast interface.
Diffstat (limited to 'src/argaze.test')
-rw-r--r-- | src/argaze.test/AreaOfInterest/AOI2DScene.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/argaze.test/AreaOfInterest/AOI2DScene.py b/src/argaze.test/AreaOfInterest/AOI2DScene.py index ecd6bbb..a73aa20 100644 --- a/src/argaze.test/AreaOfInterest/AOI2DScene.py +++ b/src/argaze.test/AreaOfInterest/AOI2DScene.py @@ -39,43 +39,43 @@ class TestAOI2DSceneClass(unittest.TestCase): gaze_position_C = GazeFeatures.GazePosition((0.5, 1.5)) # Check raycast results for gaze postion A - for name, aoi, looked in aoi_2d_scene.raycast(gaze_position_A): + for name, aoi, matching in aoi_2d_scene.raycast(gaze_position_A.value): if name == "A": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_A)) - self.assertEqual(looked, True) + self.assertEqual(matching, True) elif name == "B": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_B)) - self.assertEqual(looked, False) + self.assertEqual(matching, False) # Check raycast results for gaze postion B - for name, aoi, looked in aoi_2d_scene.raycast(gaze_position_B): + for name, aoi, matching in aoi_2d_scene.raycast(gaze_position_B.value): if name == "A": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_A)) - self.assertEqual(looked, False) + self.assertEqual(matching, False) elif name == "B": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_B)) - self.assertEqual(looked, True) + self.assertEqual(matching, True) # Check raycast results for gaze postion C - for name, aoi, looked in aoi_2d_scene.raycast(gaze_position_C): + for name, aoi, matching in aoi_2d_scene.raycast(gaze_position_C.value): if name == "A": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_A)) - self.assertEqual(looked, False) + self.assertEqual(matching, False) elif name == "B": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_B)) - self.assertEqual(looked, False) + self.assertEqual(matching, False) def test_circlecast(self): """Test AOI2DScene circlecast method.""" @@ -90,64 +90,64 @@ class TestAOI2DSceneClass(unittest.TestCase): gaze_position_D = GazeFeatures.GazePosition((0.5, 1.5), precision=0.25) # Check circlecast results for gaze postion A - for name, aoi, looked_region, aoi_ratio, gaze_ratio in aoi_2d_scene.circlecast(gaze_position_A): + for name, aoi, matching_region, aoi_ratio, circle_ratio in aoi_2d_scene.circlecast(gaze_position_A.value, gaze_position_A.precision): if name == "A": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_A)) self.assertTrue(math.isclose(aoi_ratio, math.pi / 4, abs_tol=1e-2)) - self.assertTrue(math.isclose(gaze_ratio, 1., abs_tol=1e-3)) + self.assertTrue(math.isclose(circle_ratio, 1., abs_tol=1e-3)) elif name == "B": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_B)) self.assertEqual(aoi_ratio, 0.) - self.assertEqual(gaze_ratio, 0.) + self.assertEqual(circle_ratio, 0.) # Check circlecast results for gaze postion B - for name, aoi, looked_region, aoi_ratio, gaze_ratio in aoi_2d_scene.circlecast(gaze_position_B): + for name, aoi, matching_region, aoi_ratio, circle_ratio in aoi_2d_scene.circlecast(gaze_position_B.value, gaze_position_B.precision): if name == "A": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_A)) self.assertEqual(aoi_ratio, 0.) - self.assertEqual(gaze_ratio, 0.) + self.assertEqual(circle_ratio, 0.) elif name == "B": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_B)) self.assertTrue(math.isclose(aoi_ratio, math.pi / 4, abs_tol=1e-2)) - self.assertTrue(math.isclose(gaze_ratio, 1., abs_tol=1e-3)) + self.assertTrue(math.isclose(circle_ratio, 1., abs_tol=1e-3)) # Check circlecast results for gaze postion C - for name, aoi, looked_region, aoi_ratio, gaze_ratio in aoi_2d_scene.circlecast(gaze_position_C): + for name, aoi, matching_region, aoi_ratio, circle_ratio in aoi_2d_scene.circlecast(gaze_position_C.value, gaze_position_C.precision): if name == "A": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_A)) self.assertTrue(math.isclose(aoi_ratio, math.pi / 4, abs_tol=1e-2)) - self.assertTrue(math.isclose(gaze_ratio, 1 / 4, abs_tol=1e-3)) + self.assertTrue(math.isclose(circle_ratio, 1 / 4, abs_tol=1e-3)) elif name == "B": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_B)) self.assertTrue(math.isclose(aoi_ratio, math.pi / 4, abs_tol=1e-2)) - self.assertTrue(math.isclose(gaze_ratio, 1 / 4, abs_tol=1e-3)) + self.assertTrue(math.isclose(circle_ratio, 1 / 4, abs_tol=1e-3)) # Check circlecast results for gaze postion D - for name, aoi, looked_region, aoi_ratio, gaze_ratio in aoi_2d_scene.circlecast(gaze_position_D): + for name, aoi, matching_region, aoi_ratio, circle_ratio in aoi_2d_scene.circlecast(gaze_position_D.value, gaze_position_D.precision): if name == "A": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_A)) self.assertEqual(aoi_ratio, 0.) - self.assertEqual(gaze_ratio, 0.) + self.assertEqual(circle_ratio, 0.) elif name == "B": self.assertIsNone(numpy.testing.assert_array_equal(aoi, aoi_2D_B)) self.assertEqual(aoi_ratio, 0.) - self.assertEqual(gaze_ratio, 0.) + self.assertEqual(circle_ratio, 0.) def test_copy(self): """Test AOI2DScene copy method.""" |