aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-08-15 16:22:12 +0200
committerThéo de la Hogue2023-08-15 16:22:12 +0200
commitf141200ca4edc72815a0e7bb47eab89f7cd83512 (patch)
treed6c23ed442e7b5ad1fd58e8a4edf03e96baf78e6 /src
parentf503c3945989953197c74a0aa573b91d098e2bb5 (diff)
downloadargaze-f141200ca4edc72815a0e7bb47eab89f7cd83512.zip
argaze-f141200ca4edc72815a0e7bb47eab89f7cd83512.tar.gz
argaze-f141200ca4edc72815a0e7bb47eab89f7cd83512.tar.bz2
argaze-f141200ca4edc72815a0e7bb47eab89f7cd83512.tar.xz
Replacing __str__ representation by letter_sequence property.
Diffstat (limited to 'src')
-rw-r--r--src/argaze.test/GazeFeatures.py4
-rw-r--r--src/argaze/GazeAnalysis/LempelZivComplexity.py2
-rw-r--r--src/argaze/GazeAnalysis/NGram.py2
-rw-r--r--src/argaze/GazeFeatures.py8
4 files changed, 6 insertions, 10 deletions
diff --git a/src/argaze.test/GazeFeatures.py b/src/argaze.test/GazeFeatures.py
index a6709cb..d609dd2 100644
--- a/src/argaze.test/GazeFeatures.py
+++ b/src/argaze.test/GazeFeatures.py
@@ -631,8 +631,8 @@ class TestAOIScanPathClass(unittest.TestCase):
self.assertEqual(aoi_scan_path.get_letter_aoi('B'), 'Shu')
self.assertEqual(aoi_scan_path.get_letter_aoi('C'), 'Foo')
- # Check string representation
- self.assertEqual(str(aoi_scan_path), 'ABCA')
+ # Check letter sequence representation
+ self.assertEqual(aoi_scan_path.letter_sequence, 'ABCA')
def test_transition_matrix(self):
"""Test AOIScanPath transition matrix feature."""
diff --git a/src/argaze/GazeAnalysis/LempelZivComplexity.py b/src/argaze/GazeAnalysis/LempelZivComplexity.py
index c836235..82ef05f 100644
--- a/src/argaze/GazeAnalysis/LempelZivComplexity.py
+++ b/src/argaze/GazeAnalysis/LempelZivComplexity.py
@@ -33,7 +33,7 @@ class AOIScanPathAnalyzer(GazeFeatures.AOIScanPathAnalyzer):
assert(len(aoi_scan_path) > 1)
- self.__lempel_ziv_complexity = lempel_ziv_complexity(str(aoi_scan_path))
+ self.__lempel_ziv_complexity = lempel_ziv_complexity(aoi_scan_path.letter_sequence)
@property
def lempel_ziv_complexity(self) -> int:
diff --git a/src/argaze/GazeAnalysis/NGram.py b/src/argaze/GazeAnalysis/NGram.py
index 662060e..bee9767 100644
--- a/src/argaze/GazeAnalysis/NGram.py
+++ b/src/argaze/GazeAnalysis/NGram.py
@@ -40,7 +40,7 @@ class AOIScanPathAnalyzer(GazeFeatures.AOIScanPathAnalyzer):
assert(len(aoi_scan_path) > 1)
- sequence = str(aoi_scan_path)
+ sequence = aoi_scan_path.letter_sequence
self.__ngrams_count = {}
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py
index 224e2d9..bb5f991 100644
--- a/src/argaze/GazeFeatures.py
+++ b/src/argaze/GazeFeatures.py
@@ -799,11 +799,6 @@ class AOIScanPath(list):
self.expected_aois = expected_aois
self.__duration = 0
-
- def __repr__(self):
- """String representation."""
-
- return str(super())
@property
def duration(self) -> float:
@@ -846,7 +841,8 @@ class AOIScanPath(list):
return self.__letter_aoi[letter]
- def __str__(self) -> str:
+ @property
+ def letter_sequence(self) -> str:
"""Convert aoi scan path into a string with unique letter per aoi step."""
sequence = ''