graphomotor.features.time

Feature extraction module for time-based metrics in spiral drawing data.

 1"""Feature extraction module for time-based metrics in spiral drawing data."""
 2
 3from graphomotor.core import models
 4
 5
 6def get_task_duration(spiral: models.Spiral) -> dict[str, float]:
 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]}
def get_task_duration(spiral: graphomotor.core.models.Spiral) -> dict[str, float]:
 7def get_task_duration(spiral: models.Spiral) -> dict[str, float]:
 8    """Calculate the total duration of a spiral drawing task.
 9
10    Args:
11        spiral: Spiral object containing drawing data.
12
13    Returns:
14        Dictionary containing the total duration of the task in seconds.
15    """
16    return {"duration": spiral.data["seconds"].iloc[-1]}

Calculate the total duration of a spiral drawing task.

Arguments:
  • spiral: Spiral object containing drawing data.
Returns:

Dictionary containing the total duration of the task in seconds.