dispel.providers.generic.tasks.draw.steps module#
Drawing test related functionality.
This module contains functionality to extract measures for the Drawing test (DRAW).
- class dispel.providers.generic.tasks.draw.steps.AddRawPacmanScore[source]#
Bases:
ExtractStep
,ValidPathAssertionMixin
Add the raw pacman score.
A target’s point is considered as ‘eaten’ if that point is within the radius range of any other user path’s point. The pacman score is the ratio between the number of ‘eaten’ points and the total number of target’s point.
- __init__(level_filter, **kwargs)[source]#
- Parameters:
level_filter (LevelFilter) –
kwargs (object) –
- Return type:
None
- class dispel.providers.generic.tasks.draw.steps.AggregateAxesMeanDistance[source]#
Bases:
AggregateMeasures
Aggregate mean corner max distance measure over all attempts.
- attempt = 2#
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- hand = 2#
- measure_ids: List[DefinitionIdType] = ['draw-left_sc_first-axes_over', 'draw-right_sc_first-axes_over', 'draw-left_sc_sec-axes_over', 'draw-right_sc_sec-axes_over', 'draw-left_scc_first-axes_over', 'draw-right_scc_first-axes_over', 'draw-left_scc_sec-axes_over', 'draw-right_scc_sec-axes_over', 'draw-left_inf_first-axes_over', 'draw-right_inf_first-axes_over', 'draw-left_inf_sec-axes_over', 'draw-right_inf_sec-axes_over', 'draw-left_spi_first-axes_over', 'draw-right_spi_first-axes_over', 'draw-left_spi_sec-axes_over', 'draw-right_spi_sec-axes_over']#
- shape = 4#
- class dispel.providers.generic.tasks.draw.steps.AggregateCornerMeanDistance[source]#
Bases:
AggregateMeasures
Aggregate mean corner max distance measure over all attempts.
- attempt = 2#
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- hand = 2#
- measure_ids: List[DefinitionIdType] = ['draw-left_sc_first-corner', 'draw-right_sc_first-corner', 'draw-left_sc_sec-corner', 'draw-right_sc_sec-corner', 'draw-left_scc_first-corner', 'draw-right_scc_first-corner', 'draw-left_scc_sec-corner', 'draw-right_scc_sec-corner', 'draw-left_inf_first-corner', 'draw-right_inf_first-corner', 'draw-left_inf_sec-corner', 'draw-right_inf_sec-corner', 'draw-left_spi_first-corner', 'draw-right_spi_first-corner', 'draw-left_spi_sec-corner', 'draw-right_spi_sec-corner']#
- shape = 4#
- class dispel.providers.generic.tasks.draw.steps.AggregateDistanceThresholdByHandAndShape[source]#
Bases:
DrawAggregateModalitiesByHandAndShape
Aggregate Distance threshold flag values by hand and shape.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.draw.steps.AggregateDuration[source]#
Bases:
AggregateMeasures
Average duration of drawing on all shapes, attempts and hands.
- attempt = 2#
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- hand = 2#
- measure_ids: List[DefinitionIdType] = ['draw-left_sc_first-user_dur', 'draw-right_sc_first-user_dur', 'draw-left_sc_sec-user_dur', 'draw-right_sc_sec-user_dur', 'draw-left_scc_first-user_dur', 'draw-right_scc_first-user_dur', 'draw-left_scc_sec-user_dur', 'draw-right_scc_sec-user_dur', 'draw-left_inf_first-user_dur', 'draw-right_inf_first-user_dur', 'draw-left_inf_sec-user_dur', 'draw-right_inf_sec-user_dur', 'draw-left_spi_first-user_dur', 'draw-right_spi_first-user_dur', 'draw-left_spi_sec-user_dur', 'draw-right_spi_sec-user_dur']#
- shape = 4#
- class dispel.providers.generic.tasks.draw.steps.AggregateDurationByHand[source]#
Bases:
DrawAggregateModalitiesByHand
Average duration of drawing by hand.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.draw.steps.AggregateInstantSpeed[source]#
Bases:
AggregateRawDataSetColumn
Extract instant speed measures.
- class dispel.providers.generic.tasks.draw.steps.AggregateIntersections[source]#
Bases:
AggregateMeasures
Average the number of intersections globally.
- attempt = 2#
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- hand = 2#
- measure_ids: List[DefinitionIdType] = ['draw-left_sc_first-cross', 'draw-right_sc_first-cross', 'draw-left_sc_sec-cross', 'draw-right_sc_sec-cross', 'draw-left_scc_first-cross', 'draw-right_scc_first-cross', 'draw-left_scc_sec-cross', 'draw-right_scc_sec-cross', 'draw-left_inf_first-cross', 'draw-right_inf_first-cross', 'draw-left_inf_sec-cross', 'draw-right_inf_sec-cross', 'draw-left_spi_first-cross', 'draw-right_spi_first-cross', 'draw-left_spi_sec-cross', 'draw-right_spi_sec-cross']#
- shape = 4#
- class dispel.providers.generic.tasks.draw.steps.AggregateIntersectionsByHand[source]#
Bases:
DrawAggregateModalitiesByHand
Average total number of intersections by hand.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.draw.steps.AggregateIntersectionsPerSeconds[source]#
Bases:
AggregateMeasures
Average the number of intersections per second globally.
- attempt = 2#
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- hand = 2#
- measure_ids: List[DefinitionIdType] = ['draw-left_sc_first-cross_per_sec', 'draw-right_sc_first-cross_per_sec', 'draw-left_sc_sec-cross_per_sec', 'draw-right_sc_sec-cross_per_sec', 'draw-left_scc_first-cross_per_sec', 'draw-right_scc_first-cross_per_sec', 'draw-left_scc_sec-cross_per_sec', 'draw-right_scc_sec-cross_per_sec', 'draw-left_inf_first-cross_per_sec', 'draw-right_inf_first-cross_per_sec', 'draw-left_inf_sec-cross_per_sec', 'draw-right_inf_sec-cross_per_sec', 'draw-left_spi_first-cross_per_sec', 'draw-right_spi_first-cross_per_sec', 'draw-left_spi_sec-cross_per_sec', 'draw-right_spi_sec-cross_per_sec']#
- shape = 4#
- class dispel.providers.generic.tasks.draw.steps.AggregateIntersectionsPerSecondsByHand[source]#
Bases:
DrawAggregateModalitiesByHand
Average the mean number of intersections per second by hand.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.draw.steps.AggregateSimilarity[source]#
Bases:
AggregateMeasures
Average similarity values by hand.
- attempt = 2#
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- hand = 2#
- measure_ids: List[DefinitionIdType] = ['draw-left_sc_first-sim-mean', 'draw-right_sc_first-sim-mean', 'draw-left_sc_sec-sim-mean', 'draw-right_sc_sec-sim-mean', 'draw-left_scc_first-sim-mean', 'draw-right_scc_first-sim-mean', 'draw-left_scc_sec-sim-mean', 'draw-right_scc_sec-sim-mean', 'draw-left_inf_first-sim-mean', 'draw-right_inf_first-sim-mean', 'draw-left_inf_sec-sim-mean', 'draw-right_inf_sec-sim-mean', 'draw-left_spi_first-sim-mean', 'draw-right_spi_first-sim-mean', 'draw-left_spi_sec-sim-mean', 'draw-right_spi_sec-sim-mean']#
- shape = 4#
- class dispel.providers.generic.tasks.draw.steps.AggregateSimilarityByHand[source]#
Bases:
DrawAggregateModalitiesByHand
Average similarity values by hand.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.draw.steps.AggregateSparc[source]#
Bases:
AggregateMeasures
Average smoothness scores globally.
- attempt = 2#
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- hand = 2#
- measure_ids: List[DefinitionIdType] = ['draw-left_sc_first-smooth', 'draw-right_sc_first-smooth', 'draw-left_sc_sec-smooth', 'draw-right_sc_sec-smooth', 'draw-left_scc_first-smooth', 'draw-right_scc_first-smooth', 'draw-left_scc_sec-smooth', 'draw-right_scc_sec-smooth', 'draw-left_inf_first-smooth', 'draw-right_inf_first-smooth', 'draw-left_inf_sec-smooth', 'draw-right_inf_sec-smooth', 'draw-left_spi_first-smooth', 'draw-right_spi_first-smooth', 'draw-left_spi_sec-smooth', 'draw-right_spi_sec-smooth']#
- shape = 4#
- class dispel.providers.generic.tasks.draw.steps.AggregateSparcByHand[source]#
Bases:
DrawAggregateModalitiesByHand
Average sparc values by hand.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.draw.steps.AggregateSpeedSimilarity[source]#
Bases:
AggregateMeasures
Average speed/similarity globally.
- attempt = 2#
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- hand = 2#
- measure_ids: List[DefinitionIdType] = ['draw-left_sc_first-dur_acc-mean', 'draw-right_sc_first-dur_acc-mean', 'draw-left_sc_sec-dur_acc-mean', 'draw-right_sc_sec-dur_acc-mean', 'draw-left_scc_first-dur_acc-mean', 'draw-right_scc_first-dur_acc-mean', 'draw-left_scc_sec-dur_acc-mean', 'draw-right_scc_sec-dur_acc-mean', 'draw-left_inf_first-dur_acc-mean', 'draw-right_inf_first-dur_acc-mean', 'draw-left_inf_sec-dur_acc-mean', 'draw-right_inf_sec-dur_acc-mean', 'draw-left_spi_first-dur_acc-mean', 'draw-right_spi_first-dur_acc-mean', 'draw-left_spi_sec-dur_acc-mean', 'draw-right_spi_sec-dur_acc-mean']#
- shape = 4#
- class dispel.providers.generic.tasks.draw.steps.AggregateSpeedSimilarityByHand[source]#
Bases:
DrawAggregateModalitiesByHand
Average speed/similarity values by hand.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.draw.steps.ContinuousLevel[source]#
Bases:
LevelFilter
Filter for continuous drawing shape.
- class dispel.providers.generic.tasks.draw.steps.CreatableShape[source]#
Bases:
LevelFilter
A level filter to fetch level with creatable shapes only.
- class dispel.providers.generic.tasks.draw.steps.CreatableShapeFlag[source]#
Bases:
FlagLevelStep
A Transform step to determine if the shape is creatable in a level.
- flag_severity: FlagSeverity | str = 1#
- static flagging_function(level, **_kwargs)#
Assert that the shape can be created from the level.
- Parameters:
level (Level) –
- reason: str = 'The shape was impossible to create from the level. '#
The detailed reason of the flag
- class dispel.providers.generic.tasks.draw.steps.CreateShapes[source]#
Bases:
LevelProcessingStep
A LevelProcessingStep to create a
DrawShape
per level.- process_level(level, reading, **kwargs)[source]#
Process the provided Level.
- Parameters:
level (Level) – The level to be processed
reading (Reading) – The reading to be processed
kwargs – Additional arguments passed by
process_level()
.
- Yields:
ProcessResultType – Passes through anything that is yielded from the
process_level()
function.- Return type:
Generator[ProcessingResult | ProcessingControlResult, None, None]
- dispel.providers.generic.tasks.draw.steps.DRAWING_SIM_MEDIAN_MEAN = {'inf': 6.353, 'sc': 5.753, 'scc': 5.989, 'spi': 5.821}#
Mean of similarity median on healthy population for the different shape.
- dispel.providers.generic.tasks.draw.steps.DRAWING_SIM_MEDIAN_Q95_MINUS_Q05 = {'inf': 8.096, 'sc': 8.641, 'scc': 8.952, 'spi': 6.674}#
The distance between quantile 95 and quantile 5 of similarity median on healthy population for the different shape.
- dispel.providers.generic.tasks.draw.steps.DRAWING_USER_DURATION_MEAN = {'inf': 4004, 'sc': 3877, 'scc': 3985, 'spi': 5571}#
Mean of user duration on healthy population for the different shape.
- dispel.providers.generic.tasks.draw.steps.DRAWING_USER_DURATION_Q95_MINUS_Q05 = {'inf': 6012, 'sc': 5699, 'scc': 5738, 'spi': 8671}#
The distance between quantile 95 and quantile 5 of user duration on healthy population for the different shape.
- class dispel.providers.generic.tasks.draw.steps.DRAWProcessingStepsGroupAll[source]#
Bases:
ProcessingStepGroup
Processing group for all aggregated levels.
- class dispel.providers.generic.tasks.draw.steps.DrawAggregateModalitiesByHand[source]#
Bases:
AggregateModalities
Base step to aggregate measures by hand for DRAW task.
From the definition of the measure, all the measures for the different shapes and attempts are retrieved (see get_modalities).
- __init__(hand)[source]#
- Parameters:
hand (HandModality) –
- class dispel.providers.generic.tasks.draw.steps.DrawAggregateModalitiesByHandAndShape[source]#
Bases:
AggregateModalities
Base step to aggregate measures by hand and shape for DRAW task.
From the definition of the measure, all the measures for the different attempts are retrieved (see get_modalities).
- __init__(hand, shape)[source]#
- Parameters:
hand (HandModality) –
shape (ShapeModality) –
- class dispel.providers.generic.tasks.draw.steps.DrawIntentionalTremorMeasures[source]#
Bases:
ProcessingStepGroup
A group of drawing processing steps for tremor measures.
- class dispel.providers.generic.tasks.draw.steps.DrawOppositeDirection[source]#
Bases:
FlagLevelStep
Flag infinity shape drawn clockwise.
- flag_severity: FlagSeverity | str = 1#
- level_filter: LevelFilter = <LevelFilter: ((infinity shapes and Creatable shapes) and only continuously drawn shapes)>#
- class dispel.providers.generic.tasks.draw.steps.DrawOvershootRemoval[source]#
Bases:
FlagLevelStep
Flag drawing for which we removed more than 10% of user path.
- flag_severity: FlagSeverity | str = 1#
- level_filter: LevelFilter = <LevelFilter: ((Creatable shapes and valid user path) and only continuously drawn shapes)>#
- class dispel.providers.generic.tasks.draw.steps.DrawTransformAndExtract[source]#
Bases:
ProcessingStepGroup
Processing group for all individual levels (shapes).
- Parameters:
hand – The hand on which the tremor measures are to be computed.
shape – The shape on which the tremor measures are to be computed.
attempt – The attempt on which the tremor measures are to be computed.
- __init__(hand, shape, attempt)[source]#
- Parameters:
hand (HandModality) –
shape (ShapeModality) –
attempt (AttemptModality) –
- Return type:
None
- class dispel.providers.generic.tasks.draw.steps.DrawTremorMeasures[source]#
Bases:
ProcessingStepGroup
A group of drawing processing steps for tremor measures.
- Parameters:
hand – The hand on which the tremor measures are to be computed.
sensor – The sensor on which the tremor measures are to be computed.
- __init__(hand, sensor)[source]#
- Parameters:
hand (HandModality) –
sensor (SensorModality) –
- class dispel.providers.generic.tasks.draw.steps.DrawUserDistanceThreshold[source]#
Bases:
FlagLevelStep
Flag if a drawing distance ratio is within expected range.
- flag_severity: FlagSeverity | str = 1#
- level_filter: LevelFilter = <LevelFilter: (valid user path and Creatable shapes)>#
- class dispel.providers.generic.tasks.draw.steps.DrawingFlag[source]#
Bases:
ProcessingStepGroup
Processing group for all drawing flag.
- class dispel.providers.generic.tasks.draw.steps.ExtractAxesMeanDistance[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Extract mean overshoot distance.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- static extract(distances)#
Extract mean overshoot distances.
- class dispel.providers.generic.tasks.draw.steps.ExtractCornerMeanDistance[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Extract c accuracy.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- static extract(distances)#
Extract mean maximum corner Frechet distance.
- class dispel.providers.generic.tasks.draw.steps.ExtractDTW[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Abstract class to aggregate similarity using dynamic time warping.
- class dispel.providers.generic.tasks.draw.steps.ExtractDrawingCompletionRatio[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Extract the completion ratio.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- static extract(x)#
Identity function.
- class dispel.providers.generic.tasks.draw.steps.ExtractDuration[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Extract total duration of drawing.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- extract()#
Compute the duration of the total interaction of the user with the test.
Also compute the reaction time of the user between the beginning of the test and his first interaction.
- class dispel.providers.generic.tasks.draw.steps.ExtractDurationAccuracyNormedCombined[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Extract duration accuracy normalized and combined score.
- class dispel.providers.generic.tasks.draw.steps.ExtractIntersections[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Extract total number of intersections between the user and the model.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- extract()#
Return the number of items in a container.
- class dispel.providers.generic.tasks.draw.steps.ExtractIntersectionsFrequency[source]#
Bases:
ExtractMultipleStep
,ValidPathAssertionMixin
Extract total number of intersections between the user and the model.
- class dispel.providers.generic.tasks.draw.steps.ExtractIntersectionsPerSeconds[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Extract the mean number of intersections per second.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- static extract(data)#
Get the number of crossings per second.
- Return type:
float64
- class dispel.providers.generic.tasks.draw.steps.ExtractPressure[source]#
Bases:
ExtractMultipleStep
,ValidPathAssertionMixin
Extract pressure-related measures.
- class dispel.providers.generic.tasks.draw.steps.ExtractPressureAll[source]#
Bases:
AggregateRawDataSetColumn
,ValidPathAssertionMixin
Extract pressure related measures for all levels.
- class dispel.providers.generic.tasks.draw.steps.ExtractPressureAllCV[source]#
Bases:
AggregateRawDataSetColumn
,ValidPathAssertionMixin
Extract pressure related measures for all levels.
- class dispel.providers.generic.tasks.draw.steps.ExtractReactionTime[source]#
Bases:
ExtractStep
,ValidPathAssertionMixin
Extract reaction time measures.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- transform_function(level)#
Compute the reaction time.
The reaction time of the user between the shape appearance and the first touch event.
- class dispel.providers.generic.tasks.draw.steps.ExtractReactionTimeAll[source]#
Bases:
AggregateRawDataSetColumn
,ValidPathAssertionMixin
Extract reaction time related measures for all levels.
- class dispel.providers.generic.tasks.draw.steps.ExtractShapeMixIn[source]#
Bases:
LevelProcessingStep
,MeasureDefinitionMixin
A Transformation step that applies a function on targets.
- data_set_ids = 'shape'#
- target_dtype = 'float64'#
- class dispel.providers.generic.tasks.draw.steps.ExtractSparc[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Extract spectral arc length of the up sampled user draw.
The spectral arc length is a smoothness measure method. For more information about the
sparc
function, seesparc()
.- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.draw.steps.ExtractSpeedAccuracy[source]#
Bases:
ExtractShapeMixIn
,ValidPathAssertionMixin
Extract speed accuracy.
- class dispel.providers.generic.tasks.draw.steps.FlagCompleteDrawing[source]#
Bases:
FlagLevelStep
Flag the drawing is complete.
- flag_severity: FlagSeverity | str = 1#
- class dispel.providers.generic.tasks.draw.steps.FlagContinuousDrawing[source]#
Bases:
FlagLevelStep
Flag the user do not lift the finger while drawing.
- flag_severity: FlagSeverity | str = 1#
- class dispel.providers.generic.tasks.draw.steps.InfinityShapes[source]#
Bases:
LevelFilter
A level filter to fetch level from infinity shapes.
- dispel.providers.generic.tasks.draw.steps.RADIUS = 8#
The radius of the circle used to consider if a point from the reference path has been covered by the user trajectory. The value of 8 corresponds to the size of a fingertip.
- class dispel.providers.generic.tasks.draw.steps.TransformDecelerationProfile[source]#
Bases:
TransformStep
A raw data transformation step to get the user deceleration profile.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: tsTouch (timestamp of interactions data, datetime64)>, <RawDataValueDefinition: min_distance (DTW distance data, float64)>, <RawDataValueDefinition: x (x user trajectory, float64)>, <RawDataValueDefinition: y (y user trajectory, float64)>]#
- class dispel.providers.generic.tasks.draw.steps.TransformInstantSpeed[source]#
Bases:
TransformStep
,ValidPathAssertionMixin
A raw data set transformation step to get user’s instantaneous speed.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: speed (speed, float64)>, <RawDataValueDefinition: distance (distance, float64)>]#
- class dispel.providers.generic.tasks.draw.steps.TransformReactionTime[source]#
Bases:
TransformStep
,ValidPathAssertionMixin
A raw data set transformation step to get user’s reaction time.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: reaction_time (Reaction time data, float64)>]#
- transform_function(level)#
Wrap reaction time in a Series for a better aggregation.
- Parameters:
- Returns:
A pandas Series of the user’s reaction time for the given level (in milliseconds).
- Return type:
- class dispel.providers.generic.tasks.draw.steps.TransformValidUserPath[source]#
Bases:
FlagLevelStep
A Transform step to determine if the user path is valid.
- flag_severity: FlagSeverity | str = 1#
- static flagging_function(level, reading, **_kwargs)#
Assert that there are valid paths.
- level_filter: LevelFilter = <LevelFilter: (Creatable shapes and only continuously drawn shapes)>#
- class dispel.providers.generic.tasks.draw.steps.ValidPathAssertionMixin[source]#
Bases:
LevelProcessingStepProtocol
Assertion mixin to ensure a valid path is present.
- missing_path_error_handling = 'ignore'#
The error handling should no valid path be obtained
- class dispel.providers.generic.tasks.draw.steps.ValidUserPath[source]#
Bases:
LevelFilter
A level filter to fetch level with valid user path only.
- dispel.providers.generic.tasks.draw.steps.compute_pacman_score(shape_dataset)[source]#
Compute the pacman score for a level.
- Parameters:
shape_dataset (pd.DataFrame) – A data frame containing the DrawShape object
- Returns:
The pacman score.
- Return type:
- dispel.providers.generic.tasks.draw.steps.get_instant_speed(data)[source]#
Compute the instantaneous speed of the drawing.
- Parameters:
data (DataFrame) – A pandas data frame composed of at least the user path and associated timestamps as index.
- Returns:
The instantaneous speed of the drawing.
- Return type:
numpy.float64
- dispel.providers.generic.tasks.draw.steps.get_speed_accuracy(data, mean_dist)[source]#
Compute the speed accuracy of the user for a given level.
- Parameters:
- Returns:
The speed accuracy for the given level (unit: point-1.ms-1).
- Return type:
- Raises:
AssertionError – If
speed * accuracy
is equal to zero and ends up with a ZeroDivisionError for the ratio:1 / (speed * accuracy)
.
- dispel.providers.generic.tasks.draw.steps.get_user_duration(data)[source]#
Compute the duration of the total interaction of the user with the test.
Also compute the reaction time of the user between the beginning of the test and his first interaction.
- dispel.providers.generic.tasks.draw.steps.reaction_time(data, level)[source]#
Compute the reaction time.
The reaction time of the user between the shape appearance and the first touch event.