Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/graphomotor/features/time.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Feature extraction module for time-based metrics in spiral drawing data."""

from graphomotor.core import models

Check warning on line 3 in src/graphomotor/features/time.py

View check run for this annotation

Codecov / codecov/patch

src/graphomotor/features/time.py#L3

Added line #L3 was not covered by tests


def get_task_duration(spiral: models.Spiral) -> dict:

Check warning on line 6 in src/graphomotor/features/time.py

View check run for this annotation

Codecov / codecov/patch

src/graphomotor/features/time.py#L6

Added line #L6 was not covered by tests
"""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]}

Check warning on line 15 in src/graphomotor/features/time.py

View check run for this annotation

Codecov / codecov/patch

src/graphomotor/features/time.py#L15

Added line #L15 was not covered by tests