Skip to content

Commit dfb5e89

Browse files
committed
Add feature extraction for task duration
1 parent 9570fda commit dfb5e89

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/graphomotor/features/time.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""Feature extraction module for time-based metrics in spiral drawing data."""
2+
3+
from graphomotor.core import models
4+
5+
6+
def get_task_duration(spiral: models.Spiral) -> dict:
7+
"""Calculate the total duration of a spiral drawing task.
8+
9+
Args:
10+
spiral: Spiral object containing drawing data.
11+
12+
Returns:
13+
Dictionary containing the total duration of the task in seconds.
14+
"""
15+
return {"duration": spiral.data["seconds"].iloc[-1]}

0 commit comments

Comments
 (0)