aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test
diff options
context:
space:
mode:
authorThéo de la Hogue2023-07-04 08:30:58 +0200
committerThéo de la Hogue2023-07-04 08:30:58 +0200
commit2b7261d32ad43ccac013cdc4e77e16ecb3560960 (patch)
treef8d509bb88875b5f4df8fc404ee3b5bafeba21dc /src/argaze.test
parent1289fda53815f28aee35279c00a70334afe24aab (diff)
downloadargaze-2b7261d32ad43ccac013cdc4e77e16ecb3560960.zip
argaze-2b7261d32ad43ccac013cdc4e77e16ecb3560960.tar.gz
argaze-2b7261d32ad43ccac013cdc4e77e16ecb3560960.tar.bz2
argaze-2b7261d32ad43ccac013cdc4e77e16ecb3560960.tar.xz
Renaming ArScreen into ArFrame.
Diffstat (limited to 'src/argaze.test')
-rw-r--r--src/argaze.test/GazeAnalysis/NearestNeighborIndex.py6
-rw-r--r--src/argaze.test/GazeFeatures.py10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/argaze.test/GazeAnalysis/NearestNeighborIndex.py b/src/argaze.test/GazeAnalysis/NearestNeighborIndex.py
index abd6b2c..c434e1e 100644
--- a/src/argaze.test/GazeAnalysis/NearestNeighborIndex.py
+++ b/src/argaze.test/GazeAnalysis/NearestNeighborIndex.py
@@ -21,11 +21,11 @@ class TestScanPathAnalyzer(unittest.TestCase):
def test_analyze(self):
"""Test analyze."""
- screen_dimension = (100, 100)
+ frame_dimension = (100, 100)
- nni_analyzer = NearestNeighborIndex.ScanPathAnalyzer(size=screen_dimension)
+ nni_analyzer = NearestNeighborIndex.ScanPathAnalyzer(size=frame_dimension)
- scan_path = GazeFeaturesTest.build_scan_path(6, screen_dimension)
+ scan_path = GazeFeaturesTest.build_scan_path(6, frame_dimension)
# Check aoi scan path
self.assertEqual(len(scan_path), 6)
diff --git a/src/argaze.test/GazeFeatures.py b/src/argaze.test/GazeFeatures.py
index 8cd2e56..dd3f1c0 100644
--- a/src/argaze.test/GazeFeatures.py
+++ b/src/argaze.test/GazeFeatures.py
@@ -15,7 +15,7 @@ from argaze import GazeFeatures
import numpy
import pandas
-def random_gaze_positions(size, screen_dimension: tuple[float, float] = (1, 1)):
+def random_gaze_positions(size, frame_dimension: tuple[float, float] = (1, 1)):
""" Generate random TimeStampedGazePsoitions for testing purpose.
Timestamps are current time.
GazePositions are random values.
@@ -29,7 +29,7 @@ def random_gaze_positions(size, screen_dimension: tuple[float, float] = (1, 1)):
for i in range(0, size):
# Edit gaze position
- random_gaze_position = GazeFeatures.GazePosition((random.random() * screen_dimension[0], random.random() * screen_dimension[1]))
+ random_gaze_position = GazeFeatures.GazePosition((random.random() * frame_dimension[0], random.random() * frame_dimension[1]))
# Store gaze position
ts_gaze_positions[time.time()] = random_gaze_position
@@ -303,18 +303,18 @@ class TestScanStepClass(unittest.TestCase):
self.assertEqual(scan_step.last_saccade, saccade)
self.assertGreater(scan_step.duration, 0)
-def build_scan_path(size, screen_dimension: tuple[float, float] = (1, 1)):
+def build_scan_path(size, frame_dimension: tuple[float, float] = (1, 1)):
"""Build scan path"""
scan_path = GazeFeatures.ScanPath()
for i in range(size):
- fixation = TestFixation(random_gaze_positions(10, screen_dimension))
+ fixation = TestFixation(random_gaze_positions(10, frame_dimension))
ts, _ = fixation.positions.first
scan_path.append_fixation(ts, fixation)
- saccade = TestSaccade(random_gaze_positions(2, screen_dimension))
+ saccade = TestSaccade(random_gaze_positions(2, frame_dimension))
ts, _ = saccade.positions.first
scan_path.append_saccade(ts, saccade)