From dfb5e8947ebf5460e4342cf8d379738f81fb8e36 Mon Sep 17 00:00:00 2001 From: Alp Erkent Date: Fri, 18 Apr 2025 14:25:49 -0400 Subject: [PATCH] Add feature extraction for task duration --- src/graphomotor/features/time.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/graphomotor/features/time.py diff --git a/src/graphomotor/features/time.py b/src/graphomotor/features/time.py new file mode 100644 index 0000000..c51d02c --- /dev/null +++ b/src/graphomotor/features/time.py @@ -0,0 +1,15 @@ +"""Feature extraction module for time-based metrics in spiral drawing data.""" + +from graphomotor.core import models + + +def get_task_duration(spiral: models.Spiral) -> dict: + """Calculate the total duration of a spiral drawing task. + + Args: + spiral: Spiral object containing drawing data. + + Returns: + Dictionary containing the total duration of the task in seconds. + """ + return {"duration": spiral.data["seconds"].iloc[-1]}