dispel.providers.generic.tasks.draw.touch module#

Drawing test related functionality.

This module contains functionality to wrap all touches from a Drawing test (DRAW) into a class DrawShape.

class dispel.providers.generic.tasks.draw.touch.DrawShape[source]#

Bases: object

To encapsulate the user’s interaction during a specific attempt.

The user’s data are segmented into DrawTouch.

id#

The level id corresponding to the drawn shape.

Type:

str

touches#

A list of DrawTouch

Type:

List[DrawTouch]

__init__()[source]#
property aggregate_all_touches: DrawTouch#

Aggregate all DrawTouchs.

property aggregate_valid_touches: DrawTouch#

Aggregate only valid DrawTouchs.

property all_data: DataFrame#

Get all data corresponding to the drawn shape.

property axis_overshoots: Tuple[float, float, float]#

Get the 3 distances from perpendicular axes.

check_dist_thresh(validator)[source]#

Check if distance ratio lies within a RangeValidator threshold.

Parameters:

validator (RangeValidator) –

Return type:

bool

property corners_max_dist: Tuple[float, float, float]#

Get the 3 maximum distances from corner zones.

property deceleration_data: DataFrame#

Get data to compute Intentional Tremors on specific segment.

property distance_ratio: float#

Compute distance ratio between user and expected trajectories.

The distance ratio is defined as the quotient of the valid up sampled user path length divided by the expected path length.

Returns:

The distance ratio between the valid up sampled user path length and the expected path length.

Return type:

float

classmethod from_level(level, reading)[source]#

Initialize a DrawShape from level.

Parameters:
  • level (Level) – The level from which the drawn shape is to be initialized.

  • reading (Reading) – The reading corresponding to the evaluation.

Returns:

The drawn shape.

Return type:

DrawShape

property get_reference: DataFrame#

Get the reference trajectory.

property get_up_sampled_valid_attributions: Tuple[float, DataFrame]#

Get DTW attributions on up sampled and valid user trajectory.

property get_up_sampled_valid_no_overshoot_attributions: Tuple[float, DataFrame]#

Get DTW attributions on up sampled and valid user trajectory.

The DTW attribution is computed between the user trajectory without both early starting points and final overshoot, and second, the reference trajectory without an irrelevant head. As a reminder, an irrelevant head is composed of points anterior to the closest point of the user head without early starting points.

Returns:

A tuple containing the coupling measure and the pandas data frame where lie the user/reference attributions.

Return type:

Tuple[float, pandas.DataFrame]

property get_valid_attributions: Tuple[float, DataFrame]#

Get DTW attributions on raw and valid user trajectory.

property has_invalid_data: bool#

Get whether the drawn shape has invalid data.

property has_touch: bool#

Get whether the drawn shape has attempts.

property intersection_data: Tuple[DataFrame, DataFrame]#

Get formatted data for intersection detection.

property intersection_measures: DataFrame#

Get intersection detection measures.

property is_square_like_shape: bool#

Whether the shape is a square-like shape or not.

property reference_without_head: DataFrame#

Get the reference trajectory without the head.

The new reference has the closest point of the first user point without early starting points as its head.

Returns:

The new reference trajectory fitting perfectly with the user trajectory without early starting points and final overshoot.

Return type:

pandas.DataFrame

property touches_count: int#

Get whether the drawn shape has attempts.

property up_sampled_data_without_overshoot: DataFrame#

Get valid user data without overshoot.

property up_sampled_valid_coupling_measure: float#

Get the coupling measure from up sampled and valid attributions.

Returns:

The coupling measure specific to the valid, up sampled user trajectory without overshoot.

Return type:

float

property up_sampled_valid_data: DataFrame#

Get DTW attributions on up sampled and valid user trajectory.

property up_sampled_valid_matches: DataFrame#

Get the minimum matches from up sampled and valid attributions.

Returns:

The The different point attributed to a valid up sampled user specific to the valid, up sampled user trajectory without overshoot.

Return type:

pandas.DataFrame

property up_sampled_valid_no_overshoot_coupling_measure: float#

Get the coupling measure from up sampled and valid attributions.

Specific for data without overshoot.

Returns:

The coupling measure specific to the valid, up sampled user trajectory without overshoot.

Return type:

float

property up_sampled_valid_no_overshoot_matches: DataFrame#

Get the minimum matches from up sampled and valid attributions.

Specific for data without overshoot.

Returns:

The matches specific to the valid, up sampled user trajectory without overshoot.

Return type:

pandas.DataFrame

property valid_coupling_measure: float#

Get the coupling measure from valid attributions.

property valid_data: DataFrame#

Get only valid data corresponding to the drawn shape.

property valid_matches: DataFrame#

Get the minimum matches from valid attributions.

class dispel.providers.generic.tasks.draw.touch.DrawTouch[source]#

Bases: Touch

A draw touch interaction.

__init__(data, pointer=UnknownPointer(index=0))#
Parameters:
  • data (dataclasses.InitVar[DataFrame]) –

  • pointer (Pointer) –

Return type:

None

is_valid: bool#

Is valid if the touch stated in the valid area.

property valid_up_sampled_path: DataFrame#

Provide an up sampled trajectory from a DrawTouch.