aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test/PupilAnalysis/WorkloadIndex.py
diff options
context:
space:
mode:
authorThéo de la Hogue2023-08-08 17:14:49 +0200
committerThéo de la Hogue2023-08-08 17:14:49 +0200
commit77f906729e46336b8e860b311cafdcf42087007c (patch)
tree5b6b13427b679a1b6fc4fb10eea5c47e33fa4264 /src/argaze.test/PupilAnalysis/WorkloadIndex.py
parent0e8ca119eea54e464450946c01d6b63e4e4ec1d1 (diff)
downloadargaze-77f906729e46336b8e860b311cafdcf42087007c.zip
argaze-77f906729e46336b8e860b311cafdcf42087007c.tar.gz
argaze-77f906729e46336b8e860b311cafdcf42087007c.tar.bz2
argaze-77f906729e46336b8e860b311cafdcf42087007c.tar.xz
Renaming Pupil by Pupill.
Diffstat (limited to 'src/argaze.test/PupilAnalysis/WorkloadIndex.py')
-rw-r--r--src/argaze.test/PupilAnalysis/WorkloadIndex.py56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/argaze.test/PupilAnalysis/WorkloadIndex.py b/src/argaze.test/PupilAnalysis/WorkloadIndex.py
deleted file mode 100644
index fec32ef..0000000
--- a/src/argaze.test/PupilAnalysis/WorkloadIndex.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python
-
-""" """
-
-__author__ = "Théo de la Hogue"
-__credits__ = []
-__copyright__ = "Copyright 2023, Ecole Nationale de l'Aviation Civile (ENAC)"
-__license__ = "BSD"
-
-import unittest
-import math
-
-from argaze import PupilFeatures
-from argaze.PupilAnalysis import WorkloadIndex
-
-class TestWorkloadIndexClass(unittest.TestCase):
- """Test WorkloadIndex class."""
-
- def test_analysis(self):
- """Test WorkloadIndex analysis."""
-
- ts_pupil_diameters = {
- 0: PupilFeatures.PupilDiameter(1.),
- 1: PupilFeatures.PupilDiameter(1.1),
- 2: PupilFeatures.PupilDiameter(1.2),
- 3: PupilFeatures.PupilDiameter(1.3),
- 4: PupilFeatures.PupilDiameter(1.2),
- 5: PupilFeatures.PupilDiameter(1.1),
- 6: PupilFeatures.PupilDiameter(1.),
- 7: PupilFeatures.PupilDiameter(0.9),
- 8: PupilFeatures.PupilDiameter(0.8),
- 9: PupilFeatures.PupilDiameter(0.7)
- }
-
- pupil_diameter_analyzer = WorkloadIndex.PupilDiameterAnalyzer(reference=PupilFeatures.PupilDiameter(1.), period=3)
- ts_analysis = pupil_diameter_analyzer.browse(PupilFeatures.TimeStampedPupilDiameters(ts_pupil_diameters))
-
- # Check result size
- self.assertEqual(len(ts_analysis), 3)
-
- # Check each workload index
- ts_1, analysis_1 = ts_analysis.pop_first()
- self.assertEqual(ts_1, 3)
- self.assertTrue(math.isclose(analysis_1, 0.1, abs_tol=1e-2))
-
- ts_2, analysis_2 = ts_analysis.pop_first()
- self.assertEqual(ts_2, 6)
- self.assertTrue(math.isclose(analysis_2, 0.2, abs_tol=1e-2))
-
- ts_3, analysis_3 = ts_analysis.pop_first()
- self.assertEqual(ts_3, 9)
- self.assertTrue(math.isclose(analysis_3, -0.1, abs_tol=1e-2))
-
-if __name__ == '__main__':
-
- unittest.main() \ No newline at end of file