diff options
author | Théo de la Hogue | 2024-03-12 18:05:34 +0100 |
---|---|---|
committer | Théo de la Hogue | 2024-03-12 18:05:34 +0100 |
commit | f366e0c23c052da3f481b3ffc5d27f996c5aa68d (patch) | |
tree | 01f44257f003566b4e11b0c64f7cb13c8e7b27b1 | |
parent | 2ee8b9a41db136acc9e14a4839b4791fd1dc8ce7 (diff) | |
download | argaze-f366e0c23c052da3f481b3ffc5d27f996c5aa68d.zip argaze-f366e0c23c052da3f481b3ffc5d27f996c5aa68d.tar.gz argaze-f366e0c23c052da3f481b3ffc5d27f996c5aa68d.tar.bz2 argaze-f366e0c23c052da3f481b3ffc5d27f996c5aa68d.tar.xz |
Removing last TimestampedBuffer use.
-rw-r--r-- | src/argaze/PupillFeatures.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/argaze/PupillFeatures.py b/src/argaze/PupillFeatures.py index b150f47..5fc578c 100644 --- a/src/argaze/PupillFeatures.py +++ b/src/argaze/PupillFeatures.py @@ -6,7 +6,6 @@ __copyright__ = "Copyright 2023, Ecole Nationale de l'Aviation Civile (ENAC)" __license__ = "BSD" from typing import TypeVar -from dataclasses import dataclass, field import json import math @@ -44,9 +43,6 @@ class TimeStampedPupillDiameters(DataFeatures.TimestampedObjectsList): DataFeatures.TimestampedObjectsList.__init__(self, PupillDiameter, pupill_diameters) -TimeStampedBufferType = TypeVar('TimeStampedBuffer', bound="TimeStampedBuffer") -# Type definition for type annotation convenience - class PupillDiameterAnalyzer(DataFeatures.PipelineStepObject): """Abstract class to define what should provide a pupill diameter analyser.""" @@ -56,12 +52,20 @@ class PupillDiameterAnalyzer(DataFeatures.PipelineStepObject): raise NotImplementedError('analyze() method not implemented') - def browse(self, ts_pupill_diameters: TimeStampedPupillDiameters) -> TimeStampedBufferType: - """Analyze by browsing timestamped pupill diameters.""" + def browse(self, ts_pupill_diameters: TimeStampedPupillDiameters) -> list: + """Analyze by browsing timestamped pupill diameters. + + Parameters: + ts_pupill_diameters: list of timestamped pupill diameters. + + Returns: + ts_analysis: list of (timestamp, analysis). + """ assert(type(ts_pupill_diameters) == TimeStampedPupillDiameters) - ts_analyzis = DataFeatures.TimeStampedBuffer() + # TODO: Have TimestampedDataDictionary and TimestampedDataDictionaryList classes? + ts_analyzis = [] # Iterate on pupill diameters for pupill_diameter in ts_pupill_diameters: @@ -70,6 +74,6 @@ class PupillDiameterAnalyzer(DataFeatures.PipelineStepObject): if analysis is not None: - ts_analyzis[ts] = analysis + ts_analyzis.append((pupill_diameter.timestamp, analysis)) return ts_analyzis |