dispel.providers.generic.tasks.pinch.steps module#

Pinch test related functionality.

This module contains functionality to extract measures for the Pinch test (PINCH).

dispel.providers.generic.tasks.pinch.steps.ATTEMPT_DURATION_VALIDATOR = <RangeValidator: [0, 40]>#

A validator that ensures values are comprise between zero and forty seconds

Parameters:

value (Any) –

dispel.providers.generic.tasks.pinch.steps.ATTEMPT_DURATION_VALIDATOR_MS = <RangeValidator: [0, 40000.0]>#

A validator that ensures values are comprise between zero and forty seconds in milliseconds

Parameters:

value (Any) –

class dispel.providers.generic.tasks.pinch.steps.AggregateDoubleTouchAsynchronyByHand[source]#

Bases: AggregateModalities

Aggregate double touch asynchrony by hand.

__init__(hand, attempt)[source]#
Parameters:
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

get_definition(**kwargs)[source]#

Get the definition.

Return type:

ValueDefinition

get_modalities()[source]#

Get the modalities.

Return type:

List[List[str | AbbreviatedValue]]

class dispel.providers.generic.tasks.pinch.steps.AggregatePinchAccuracyByHand[source]#

Bases: PinchAggregateModalitiesByHand

Aggregate pinch accuracy by hand.

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

class dispel.providers.generic.tasks.pinch.steps.AggregateSuccessfulPinchesByHand[source]#

Bases: PinchAggregateModalitiesByHand

Aggregate successful pinch attempts by hand.

static aggregation_method(data)#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

class dispel.providers.generic.tasks.pinch.steps.AggregateTotalPinchAttemptsByHand[source]#

Bases: PinchAggregateModalitiesByHand

Extract the total pinch attempts.

static aggregation_method(data)#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

class dispel.providers.generic.tasks.pinch.steps.BubbleSizeTransformMixin[source]#

Bases: object

A raw data set transformation processing step for Bubble.

Parameters:

size – Bubble size modality.

__init__(*args, **kwargs)[source]#
get_definition(**kwargs)[source]#

Get the definition.

Return type:

ValueDefinition

get_level_filter()[source]#

Get the level filter based on the bubble size.

Return type:

LevelFilter

class dispel.providers.generic.tasks.pinch.steps.ExtractContactDistance[source]#

Bases: ExtractFingerSuccessBase

A measure extraction processing step for multiple contact distances.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), (<function variation>, 'coefficient of variation'), ('median', 'median')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'contact distance'#
class dispel.providers.generic.tasks.pinch.steps.ExtractDoubleTouchAsynchrony[source]#

Bases: AggregateRawDataSetColumn

An extraction step for multiple double touch asynchrony values.

__init__(attempt)[source]#
Parameters:

attempt (AttemptSelectionModality) –

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), (<function variation>, 'coefficient of variation')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

class dispel.providers.generic.tasks.pinch.steps.ExtractDwellTime[source]#

Bases: AggregateRawDataSetColumn

A measure extraction processing step for multiple dwell times.

__init__(attempt)[source]#
Parameters:

attempt (AttemptSelectionModality) –

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), (<function variation>, 'coefficient of variation')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

class dispel.providers.generic.tasks.pinch.steps.ExtractFingerSuccessBase[source]#

Bases: TransformApplyMeasureMixin, AggregateRawDataSetColumn

A measure extraction processing step for finger and success modalities.

Parameters:
  • finger – The desired finger to compute (‘top’ or ‘bottom’).

  • outcome – Pinching attempt success modality

__init__(finger, outcome=AttemptOutcomeModality.ALL)[source]#
Parameters:
get_column_id()[source]#

Get column id.

Return type:

str

get_data_set_id()[source]#

Get data set id.

Return type:

str

get_definition(**kwargs)[source]#

Get value definition.

Return type:

ValueDefinition

class dispel.providers.generic.tasks.pinch.steps.ExtractFirstPushes[source]#

Bases: ExtractFingerSuccessBase

A measure extraction processing step for first finger pushes.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('median', 'median'), (<function variation>, 'coefficient of variation')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'first push'#
class dispel.providers.generic.tasks.pinch.steps.ExtractFirstReactionTimeByHand[source]#

Bases: HandModalityFilterMixin, ExtractStep

A first pinch reaction time by hand extraction step.

data_set_ids: str | Iterable[str] = 'melted_targets'#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

get_level_filter()[source]#

Get level filter.

Return type:

LevelFilter

class dispel.providers.generic.tasks.pinch.steps.ExtractJerk[source]#

Bases: ExtractFingerSuccessBase

A measure extraction processing step for multiple jerk finger.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('median', 'median'), ('std', 'standard deviation')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'jerk'#
class dispel.providers.generic.tasks.pinch.steps.ExtractMeanSquaredJerk[source]#

Bases: ExtractFingerSuccessBase

A measure extraction for multiple mean squared jerk.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), (<function variation>, 'coefficient of variation'), ('median', 'median')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'ms jerk'#
class dispel.providers.generic.tasks.pinch.steps.ExtractMeanSquaredPressureJerk[source]#

Bases: ExtractFingerSuccessBase

A measure extraction for multiple mean squared jerk of pressures.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('median', 'median'), ('std', 'standard deviation')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'ms pressure jerk'#
class dispel.providers.generic.tasks.pinch.steps.ExtractPinchAccuracy[source]#

Bases: TargetPropertiesExtractStep

A pinch accuracy extraction step.

accuracy(data)[source]#

Extract pinch accuracy.

Parameters:

data (DataFrame) –

Return type:

float | float64

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

flag_data_sets(data_sets, level, reading, **kwargs)[source]#

Flag that there is at least one pinch attempt.

Parameters:
Return type:

Generator[Flag, None, None]

class dispel.providers.generic.tasks.pinch.steps.ExtractPinchTimeToPeakByHandFinger[source]#

Bases: ProcessingStepGroup

A group of pinch extract steps for time to peak speed computation.

Parameters:
  • hand – Handedness for tasks that are applied to different hands.

  • finger – Pinching fingers modality.

__init__(hand, finger)[source]#
Parameters:
class dispel.providers.generic.tasks.pinch.steps.ExtractPinchingDuration[source]#

Bases: ExtractSuccessBase

A measure extraction processing step for multiple pinching durations.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), (<function variation>, 'coefficient of variation')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'pinching duration'#
class dispel.providers.generic.tasks.pinch.steps.ExtractPressureJerk[source]#

Bases: ExtractFingerSuccessBase

A measure extraction processing step for multiple jerk pressures.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), (<function variation>, 'coefficient of variation'), ('median', 'median')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'pressure jerk'#
class dispel.providers.generic.tasks.pinch.steps.ExtractPressures[source]#

Bases: ExtractFingerSuccessBase

A measure extraction processing step for multiple finger pressures.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('median', 'median'), ('std', 'standard deviation'), ('skew', 'skewness'), ('kurtosis', 'kurtosis'), (<function variation>, 'coefficient of variation')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'pressure'#
class dispel.providers.generic.tasks.pinch.steps.ExtractReactionTime[source]#

Bases: AggregateRawDataSetColumn

A measure reaction time extraction processing step.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), (<function variation_increase>, 'coefficient of variation increase'), ('median', 'median'), ('std', 'standard deviation'), ('min', 'minimum'), ('max', 'maximum'), (<function variation>, 'coefficient of variation'), (functools.partial(<function Series.quantile>, q=0.95), '95th percentile')]#
column_id: str = 'reaction_time'#
data_set_ids: str | Iterable[str] = 'reaction-time'#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

level_filter: LevelFilter = <LevelIdFilter: level id in [melted_levels]>#
Parameters:

levels (Iterable[Level]) –

Return type:

Set[Level]

class dispel.providers.generic.tasks.pinch.steps.ExtractReactionTimeByBubbleSize[source]#

Bases: BubbleSizeTransformMixin, AggregateRawDataSetColumn

A measure reaction time by bubble size extraction processing step.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), (<function variation>, 'coefficient of variation')]#
column_id: str = 'bubble-reaction-time'#
data_set_ids: str | Iterable[str] = 'bubble_reaction_time'#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

class dispel.providers.generic.tasks.pinch.steps.ExtractReactionTimeByHand[source]#

Bases: HandModalityFilterMixin, AggregateRawDataSetColumn

A pinch reaction time by hand extraction step.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), (<function variation_increase>, 'coefficient of variation increase'), ('median', 'median'), ('std', 'standard deviation'), ('min', 'minimum'), ('max', 'maximum'), (<function variation>, 'coefficient of variation'), (functools.partial(<function Series.quantile>, q=0.95), '95th percentile')]#
column_id: str = 'reaction_time'#
data_set_ids: str | Iterable[str] = 'reaction-time'#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

get_level_filter()[source]#

Get level filter.

Return type:

LevelFilter

class dispel.providers.generic.tasks.pinch.steps.ExtractSingleShotDuration[source]#

Bases: HandModalityFilterMixin, AggregateRawDataSetColumn

Aggregate single shot duration processing step.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), (<function variation>, 'coefficient of variation')]#
column_id: str = 'duration'#
data_set_ids: str | Iterable[str] = 'single-shot-duration'#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

get_level_filter()[source]#

Get level filter.

Return type:

LevelFilter

class dispel.providers.generic.tasks.pinch.steps.ExtractSpeed[source]#

Bases: ExtractFingerSuccessBase

A measure extraction processing step for multiple finger speed.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('median', 'median'), ('std', 'standard deviation'), (functools.partial(<function Series.quantile>, q=0.95), '95th percentile')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'speed'#
class dispel.providers.generic.tasks.pinch.steps.ExtractSuccessBase[source]#

Bases: TransformApplyMeasureMixin, AggregateRawDataSetColumn

A measure extraction processing step for success modality.

Parameters:

outcome – Pinching attempt success modality

__init__(outcome=AttemptOutcomeModality.ALL)[source]#
Parameters:

outcome (AttemptOutcomeModality) –

get_column_id()[source]#

Get column id.

Return type:

str

get_data_set_id()[source]#

Get data set id.

Return type:

str

get_definition(**kwargs)[source]#

Get value definition.

Return type:

ValueDefinition

class dispel.providers.generic.tasks.pinch.steps.ExtractSuccessDeformingDuration[source]#

Bases: ExtractSuccessBase

A measure extraction processing step for multiple success durations.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), (<function variation>, 'coefficient of variation')]#
definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

measure: str = 'success duration'#
class dispel.providers.generic.tasks.pinch.steps.ExtractSuccessfulPinchAttempts[source]#

Bases: TargetPropertiesExtractStep

Extract successful pinch attempts.

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

transform_function()#
Parameters:

data (DataFrame) –

Return type:

float

class dispel.providers.generic.tasks.pinch.steps.ExtractTimeToPeakAsynchronicity[source]#

Bases: HandModalityFilterMixin, AggregateRawDataSetColumn

Aggregate time to peak asynchronicity.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), (functools.partial(<function Series.quantile>, q=0.95), '95th percentile'), (<function variation>, 'coefficient of variation')]#
column_id: str = 'peak_asynchro'#
data_set_ids: str | Iterable[str] = 'time-to-peak-speed'#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

get_level_filter()[source]#

Get level filter.

Return type:

LevelFilter

class dispel.providers.generic.tasks.pinch.steps.ExtractTimeToPeakSpeedFinger[source]#

Bases: HandModalityFilterMixin, AggregateRawDataSetColumn

Aggregate single time to peak processing step.

__init__(hand, finger)[source]#
Parameters:
aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), (functools.partial(<function Series.quantile>, q=0.95), '95th percentile'), (<function variation>, 'coefficient of variation')]#
data_set_ids: str | Iterable[str] = 'time-to-peak-speed'#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

get_level_filter()[source]#

Get level filter.

Return type:

LevelFilter

class dispel.providers.generic.tasks.pinch.steps.ExtractTotalDuration[source]#

Bases: AggregateRawDataSetColumn

A measure total duration extraction processing step.

aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), (<function variation>, 'coefficient of variation')]#
column_id: str = 'total_duration'#
data_set_ids: str | Iterable[str] = 'total-duration'#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

class dispel.providers.generic.tasks.pinch.steps.ExtractTotalPinchAttempts[source]#

Bases: TargetPropertiesExtractStep

Extract the total pinch attempts.

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

transform_function()#
Parameters:

data (DataFrame) –

Return type:

float

class dispel.providers.generic.tasks.pinch.steps.HandModalityFilterMixin[source]#

Bases: object

A raw data set transformation processing step for Bubble.

Parameters:

hand – Handedness for tasks that are applied to different hands.

__init__(*args, **kwargs)[source]#
get_definition(**kwargs)[source]#

Get the definition.

Return type:

ValueDefinition

get_level_filter()[source]#

Get level filter.

Return type:

LevelFilter

class dispel.providers.generic.tasks.pinch.steps.Pinch1ShotDurationByHand[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps for single shot duration by hands.

Parameters:

hand – Handedness for tasks that are applied to different hands.

__init__(hand)[source]#
Parameters:

hand (HandModality) –

class dispel.providers.generic.tasks.pinch.steps.PinchAggregateModalitiesByHand[source]#

Bases: AggregateModalities

Base step to aggregate measures by hand for PINCH task.

Parameters:

hand – The hand modality for which to aggregate measures.

__init__(hand)[source]#
Parameters:

hand (HandModality) –

get_definition(**kwargs)[source]#

Get the definition.

Return type:

ValueDefinition

get_modalities()[source]#

Get the modalities.

Return type:

List[List[str | AbbreviatedValue]]

class dispel.providers.generic.tasks.pinch.steps.PinchConcatenateBubbles[source]#

Bases: ConcatenateLevels

A pinch bubble size level concatenation step for target data sets.

Parameters:

size – The hand to which the levels are to be concatenated.

__init__(size)[source]#
Parameters:

size (BubbleSizeModality) –

class dispel.providers.generic.tasks.pinch.steps.PinchConcatenateHands[source]#

Bases: HandModalityFilterMixin, ConcatenateLevels

A pinch hand level concatenation step.

Parameters:
  • hand – The hand to which the levels are to be concatenated.

  • data_set_id – The data set id(s) that will be merged.

__init__(hand, data_set_id)[source]#
Parameters:
class dispel.providers.generic.tasks.pinch.steps.PinchConcatenateHandsGroup[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps for measures by hands.

Parameters:

hand – Handedness for tasks that are applied to different hands.

__init__(hand)[source]#
Parameters:

hand (HandModality) –

class dispel.providers.generic.tasks.pinch.steps.PinchConcatenateTargets[source]#

Bases: TransformStep

A pinch target level concatenation step.

data_set_ids: str | Iterable[str] = 'screen'#

An iterable of data sets to be being processed

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: targets (Concatenated pinch level data)>]#
new_data_set_id: str = 'melted_targets'#
class dispel.providers.generic.tasks.pinch.steps.PinchConcatenateTargetsLevels[source]#

Bases: ConcatenateLevels

A level concatenation step.

__init__()[source]#
class dispel.providers.generic.tasks.pinch.steps.PinchFlag[source]#

Bases: ProcessingStepGroup

Processing group for all drawing flag.

__init__()[source]#
class dispel.providers.generic.tasks.pinch.steps.PinchProcessingAggregate[source]#

Bases: ProcessingStepGroup

A group of pinch aggregating steps on hands.

Parameters:

hand – Handedness for tasks that are applied to different hands.

__init__(hand)[source]#
Parameters:

hand (HandModality) –

class dispel.providers.generic.tasks.pinch.steps.PinchProcessingHandSensor[source]#

Bases: ProcessingStepGroup

A group of pinch 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:
class dispel.providers.generic.tasks.pinch.steps.PinchProcessingHandSize[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps for measures by bubbles and hands.

Parameters:
  • hand – Handedness for tasks that are applied to different hands.

  • size – Bubble size modality.

__init__(hand, size)[source]#
Parameters:
class dispel.providers.generic.tasks.pinch.steps.PinchProcessingHandSizeAttempt[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps by bubbles, hands and attempts.

Parameters:
  • hand – Handedness for tasks that are applied to different hands.

  • size – Bubble size modality.

  • attempt – Pinching attempt selection modality.

__init__(hand, size, attempt)[source]#
Parameters:
class dispel.providers.generic.tasks.pinch.steps.PinchProcessingHandSizeFinger[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps by bubbles, hands and finger.

Parameters:
  • hand – Handedness for tasks that are applied to different hands.

  • size – Bubble size modality.

  • finger – Pinching fingers modality.

__init__(hand, size, finger)[source]#
Parameters:
class dispel.providers.generic.tasks.pinch.steps.PinchProcessingHandSizeFingerSuccess[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps by bubbles, hands, finger and success.

Parameters:
  • hand – Handedness for tasks that are applied to different hands.

  • size – Bubble size modality.

  • outcome – Pinching attempt success modality.

  • finger – Pinching fingers modality.

__init__(hand, size, outcome, finger)[source]#
Parameters:
class dispel.providers.generic.tasks.pinch.steps.PinchProcessingHandSizeSuccess[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps by bubbles, hands and success.

Parameters:
  • hand – Handedness for tasks that are applied to different hands.

  • size – Bubble size modality.

  • outcome – Pinching attempt success modality.

__init__(hand, size, outcome)[source]#
Parameters:
class dispel.providers.generic.tasks.pinch.steps.PinchProcessingLevel[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps for measures by level id.

Parameters:

level_id – Level id.

__init__(level_id)[source]#
Parameters:

level_id (str) –

class dispel.providers.generic.tasks.pinch.steps.PinchProcessingLevelTarget[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps for measures by targets.

__init__()[source]#
class dispel.providers.generic.tasks.pinch.steps.PinchProcessingSize[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps for measures by bubble size.

__init__(size)[source]#
Parameters:

size (BubbleSizeModality) –

class dispel.providers.generic.tasks.pinch.steps.PinchProcessingStepGroup[source]#

Bases: ProcessingStepGroup

A group of all pinch processing steps for measures extraction.

__init__()[source]#
class dispel.providers.generic.tasks.pinch.steps.PinchReactionTimeByHand[source]#

Bases: ProcessingStepGroup

A group of pinch processing steps for reaction time measures by hands.

Parameters:

hand – Handedness for tasks that are applied to different hands.

__init__(hand)[source]#
Parameters:

hand (HandModality) –

class dispel.providers.generic.tasks.pinch.steps.PinchTimeToPeakByHand[source]#

Bases: ProcessingStepGroup

A group of pinch steps for time to peak speed computation.

Parameters:

hand – Handedness for tasks that are applied to different hands.

__init__(hand)[source]#
Parameters:

hand (HandModality) –

class dispel.providers.generic.tasks.pinch.steps.TargetPropertiesExtractStep[source]#

Bases: ExtractStep

A base class for all extraction steps from target properties.

data_set_ids: str | Iterable[str] = 'target-properties'#

An iterable of data sets to be being processed

class dispel.providers.generic.tasks.pinch.steps.TransformApplyMeasureMixin[source]#

Bases: object

A raw data set transformation processing step for measures.

property data_id#

Get data set id from measure name.

description: str = ''#
get_column_id()[source]#

Get column id.

Return type:

str

get_column_name()[source]#

Get column name.

Return type:

str

get_data_set_id()[source]#

Get data set id.

Return type:

str

get_definitions()[source]#

Get definition.

Return type:

List[RawDataValueDefinition]

get_new_data_set_id()[source]#

Get new data set id.

Return type:

str

measure: str = ''#
property measure_id#

Get data measure id from measure name.

class dispel.providers.generic.tasks.pinch.steps.TransformApplyMeltedLevels[source]#

Bases: TransformMeltedLevels

A Transformation step that applies a function on targets.

apply: Callable[[...], Any]#
get_apply_function()[source]#

Get the function to be applied to the data set.

Return type:

Any

post_process_apply(data)[source]#

Post process the data returned from the applied function.

Parameters:

data (Any) –

Return type:

Any

target_dtype = 'float64'#
class dispel.providers.generic.tasks.pinch.steps.TransformAttempt[source]#

Bases: TransformApplyMeasureMixin, TransformWrapExplodeMeltedLevels

A raw data set transformation processing step for finger.

Parameters:
  • finger – The desired finger to compute (‘top’ or ‘bottom’).

  • outcome – Pinching attempt success modality.

__init__(finger, outcome=AttemptOutcomeModality.ALL)[source]#
Parameters:
get_apply_function()[source]#

Get the pinching attempts’ for the specific measure.

Return type:

Any

get_column_id()[source]#

Get column id.

Return type:

str

get_column_name()[source]#

Get column name.

Return type:

str

get_finger(attempt)[source]#

Get finger from an attempt.

Parameters:

attempt (PinchAttempt) –

Return type:

PinchTouch

get_new_data_set_id()[source]#

Get new data set id.

Return type:

str

abstract get_property(attempt)[source]#

Get property from an attempt.

Parameters:

attempt (Touch) –

Return type:

Any

class dispel.providers.generic.tasks.pinch.steps.TransformAttemptPeakSpeed[source]#

Bases: TransformMeltedLevels

Compute attempts peak speed properties for successful pinches.

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: targets (targets)>, <RawDataValueDefinition: attempts (attempts)>, <RawDataValueDefinition: hand (hand)>, <RawDataValueDefinition: size (size)>, <RawDataValueDefinition: appearance (appearance)>, <RawDataValueDefinition: attempt_start (attempt_start)>, <RawDataValueDefinition: tf_start (tf_start)>, <RawDataValueDefinition: tf_peaks_index (tf_peaks_index)>, <RawDataValueDefinition: tf_peaks_amp (tf_peaks_amp)>, <RawDataValueDefinition: bf_start (bf_start)>, <RawDataValueDefinition: bf_peaks_index (bf_peaks_index)>, <RawDataValueDefinition: bf_peaks_amp (bf_peaks_amp)>]#
get_peak_speed_properties(data)[source]#

Return a data set of single shot duration.

Parameters:

data (DataFrame) –

Return type:

DataFrame

new_data_set_id: str = 'peak-speed-properties'#
class dispel.providers.generic.tasks.pinch.steps.TransformContactDistance[source]#

Bases: TransformParallelExplodeMeltedLevels

A raw data set transformation processing step for contact distance.

description: str = 'The distance between the initial point of contact with the screen and the surface of the target bubble for the {finger} for {outcome} attempt.'#
get_property(target)[source]#

Get property from a target.

Parameters:

target (PinchTarget) –

Return type:

List[float]

measure: str = 'contact distance'#
class dispel.providers.generic.tasks.pinch.steps.TransformDoubleTouchAsynchrony[source]#

Bases: TransformExplodeMeltedLevelsAttempt

A transformation step to get user’s double touch asynchrony.

description: str = 'Time difference between the first and second finger touching the screen for {attempt} pinch attempts.'#
get_apply_function()[source]#

Get the pinching attempts’ double touch asynchrony.

Return type:

Any

measure: str = 'double touch asynchrony'#
class dispel.providers.generic.tasks.pinch.steps.TransformDwellTime[source]#

Bases: TransformExplodeMeltedLevelsAttempt

A raw data set transformation step to get user’s dwell time.

description: str = 'Time spent between the first screen touching and the initiation of the movement for {attempt} pinch attempts.'#
get_apply_function()[source]#

Get the pinching attempts’ dwell times.

Return type:

Any

measure: str = 'dwell time'#
class dispel.providers.generic.tasks.pinch.steps.TransformExplodeMeltedLevelsAttempt[source]#

Bases: TransformApplyMeasureMixin, TransformWrapExplodeMeltedLevels

A Transformation step that applies a function on targets.

__init__(attempt)[source]#
Parameters:

attempt (AttemptSelectionModality) –

get_column_id()[source]#

Get column id.

Return type:

str

get_column_name()[source]#

Get column name.

Return type:

str

get_new_data_set_id()[source]#

Get new data set id.

Return type:

str

class dispel.providers.generic.tasks.pinch.steps.TransformExplodeMeltedLevelsSuccess[source]#

Bases: TransformApplyMeasureMixin, TransformWrapExplodeMeltedLevels

A Transformation step that applies a function on targets.

__init__(outcome=AttemptOutcomeModality.ALL)[source]#
Parameters:

outcome (AttemptOutcomeModality) –

get_column_id()[source]#

Get column id.

Return type:

str

get_column_name()[source]#

Get column name.

Return type:

str

get_new_data_set_id()[source]#

Get new data set id.

Return type:

str

class dispel.providers.generic.tasks.pinch.steps.TransformFirstPushes[source]#

Bases: TransformParallelExplodeMeltedLevels

A raw data set transformation processing step first finger pushes.

description: str = 'The value of the first push of pressure applied on the screen by the {finger} for {outcome} attempt.'#
get_property(target)[source]#

Get property from a target.

Parameters:

target (PinchTarget) –

Return type:

List[float]

measure: str = 'first push'#
class dispel.providers.generic.tasks.pinch.steps.TransformJerk[source]#

Bases: TransformAttempt

A raw data set transformation processing step to get jerk movements.

description: str = 'The jerk of the {finger} during {outcome} pinch attempts.'#
get_property(attempt)[source]#

Get property from an attempt.

Parameters:

attempt (Touch) –

Return type:

List[float]

measure: str = 'jerk'#
class dispel.providers.generic.tasks.pinch.steps.TransformMeanSquaredJerk[source]#

Bases: TransformAttempt

A raw data set transformation processing step for mean squared jerk.

description: str = 'The mean squared jerk of the {finger} during {outcome} pinch attempts.'#
get_property(attempt)[source]#

Get property from an attempt.

Parameters:

attempt (Touch) –

Return type:

List[float]

measure: str = 'ms jerk'#
class dispel.providers.generic.tasks.pinch.steps.TransformMeanSquaredPressureJerk[source]#

Bases: TransformAttempt

A processing step to get mean squared jerk pressure.

description: str = 'The mean squared jerk pressure of the {finger} during {outcome} pinch attempts.'#
get_property(attempt)[source]#

Get property from an attempt.

Parameters:

attempt (Touch) –

Return type:

List[float]

measure: str = 'ms pressure jerk'#
class dispel.providers.generic.tasks.pinch.steps.TransformMeltedLevels[source]#

Bases: TransformStep

Transformation step based on melted levels.

data_set_ids: str | Iterable[str] = 'melted_targets'#

An iterable of data sets to be being processed

class dispel.providers.generic.tasks.pinch.steps.TransformParallelExplodeMeltedLevels[source]#

Bases: TransformApplyMeasureMixin, TransformApplyMeltedLevels

A Transformation step that applies function with a post process.

__init__(finger, outcome=AttemptOutcomeModality.ALL)[source]#
Parameters:
get_apply_function()[source]#

Get the pinching attempts’ property.

Return type:

Any

get_column_id()[source]#

Get column id.

Return type:

str

get_column_name()[source]#

Get column name.

Return type:

str

get_new_data_set_id()[source]#

Get new data set id.

Return type:

str

abstract get_property(target)[source]#

Get property from an attempt.

Parameters:

target (PinchTarget) –

Return type:

Any

post_process_apply(data)[source]#

Parallel explode passed data.

Parameters:

data (Any) –

Return type:

Any

class dispel.providers.generic.tasks.pinch.steps.TransformPinchingDuration[source]#

Bases: TransformExplodeMeltedLevelsSuccess

A raw data set transformation step to get user’s pinching duration.

To get the pinching duration of the user.

description: str = 'Time spent actually deforming the target bubble during {outcome} pinch attempt.'#
get_apply_function()[source]#

Get the pinching duration from attempt.

Return type:

Any

measure: str = 'pinching duration'#
class dispel.providers.generic.tasks.pinch.steps.TransformPressureJerk[source]#

Bases: TransformAttempt

A raw data set transformation processing step to get jerk pressure.

description: str = 'The jerk pressure of the {finger} during {outcome} pinch attempts.'#
get_property(attempt)[source]#

Get property from an attempt.

Parameters:

attempt (Touch) –

Return type:

List[float]

measure: str = 'pressure jerk'#
class dispel.providers.generic.tasks.pinch.steps.TransformPressures[source]#

Bases: TransformAttempt

A raw data set transformation processing step for finger pressures.

description: str = 'The pressure applied on the screen by the {finger} for {outcome} attempt.'#
get_property(attempt)[source]#

Get property from an attempt.

Parameters:

attempt (Touch) –

Return type:

List[float]

measure: str = 'pressure'#
class dispel.providers.generic.tasks.pinch.steps.TransformReactionTime[source]#

Bases: TransformMeltedLevels

A raw data set transformation step to get user’s reaction time.

compute_reaction_time(data, reading)[source]#

Overwrite transformation.

Parameters:
Return type:

Series

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: reaction_time (Reaction time data, float64)>]#
new_data_set_id: str = 'reaction-time'#
class dispel.providers.generic.tasks.pinch.steps.TransformReactionTimeByBubbleSize[source]#

Bases: BubbleSizeTransformMixin, TransformApplyMeasureMixin, TransformMeltedLevels

A transformation step to get user’s reaction time by bubble size.

compute_reaction_time(data, reading)[source]#

Overwrite transformation.

Parameters:
Return type:

Series

description: str = 'The time spent between the appearance of the pinch target and actually touching the screen for bubble size {size}.'#
measure: str = 'bubble reaction time'#
class dispel.providers.generic.tasks.pinch.steps.TransformSingleShotDuration[source]#

Bases: TransformMeltedLevels

A raw data set transformation step to get single shot duration.

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: targets (targets)>, <RawDataValueDefinition: duration (duration, ms)>, <RawDataValueDefinition: hand (hand)>, <RawDataValueDefinition: size (size)>, <RawDataValueDefinition: appearance (appearance)>, <RawDataValueDefinition: n_attempts (number of attempts)>, <RawDataValueDefinition: is_successful (is successful)>]#
new_data_set_id: str = 'single-shot-duration'#
single_shot(data)[source]#

Return a data set of single shot duration.

Parameters:

data (DataFrame) –

Return type:

DataFrame

class dispel.providers.generic.tasks.pinch.steps.TransformSpeed[source]#

Bases: TransformAttempt

A raw data set transformation processing step to get finger speed.

description: str = 'The speed of the {finger} during {outcome} pinch attempts.'#
get_property(attempt)[source]#

Get property from an attempt.

Parameters:

attempt (Touch) –

Return type:

List[float]

measure: str = 'speed'#
class dispel.providers.generic.tasks.pinch.steps.TransformSuccessDeformingDuration[source]#

Bases: TransformExplodeMeltedLevelsSuccess

A raw data set transformation step to get user’s success duration.

description: str = 'Time spent before succeeding at deforming the target bubble during {outcome} pinch attempt.'#
get_apply_function()[source]#

Get the success duration from attempt.

Return type:

Any

measure: str = 'success duration'#
class dispel.providers.generic.tasks.pinch.steps.TransformTargetProperties[source]#

Bases: TransformApplyMeltedLevels

A raw data set transformation processing step for target properties.

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: total_pinches (total pinches data, int32)>, <RawDataValueDefinition: successful_pinches (successful pinches data, int32)>]#
get_apply_function()[source]#

Get the number of total and successful pinch attempts.

Return type:

Any

new_data_set_id: str = 'target-properties'#
target_dtype = 'int32'#
class dispel.providers.generic.tasks.pinch.steps.TransformTimeToPeak[source]#

Bases: TransformStep

Compute attempts time to peak speed properties.

data_set_ids: str | Iterable[str] = 'peak-speed-properties'#

An iterable of data sets to be being processed

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: tf_peak_time (tf_peak_time)>, <RawDataValueDefinition: bf_peak_time (bf_peak_time)>, <RawDataValueDefinition: tf_n_peaks (tf_n_peaks)>, <RawDataValueDefinition: bf_n_peaks (bf_n_peaks)>, <RawDataValueDefinition: peak_asynchro (peak_asynchro, ms)>]#
get_time_to_peak(data)[source]#

Return a data set of time to peak.

Parameters:

data (DataFrame) –

Return type:

DataFrame

new_data_set_id: str = 'time-to-peak-speed'#
class dispel.providers.generic.tasks.pinch.steps.TransformTotalDuration[source]#

Bases: TransformApplyMeltedLevels

A raw data set transformation step to get pinch total duration.

apply()#

Compute the total duration of the pinch attempts.

Parameters:

target (PinchTarget) – A pinch target object.

Returns:

The computed total duration in s.

Return type:

float

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: total_duration (Total duration data, float64)>]#
new_data_set_id: str = 'total-duration'#
class dispel.providers.generic.tasks.pinch.steps.TransformWrapExplodeMeltedLevels[source]#

Bases: TransformApplyMeltedLevels

A Transformation step that applies a function on targets.

post_process_apply(data)[source]#

Apply post-processing.

Parameters:

data (Any) –

Return type:

Any

dispel.providers.generic.tasks.pinch.steps.attempts_from_targets(target)[source]#

Extract several parameters from a pinch target.

The parameters extracted are: hand, size, appearance and attempts.

Parameters:

target (PinchTarget) – A pinch target object.

Returns:

The hand, the size, the appearance timestamp, the attempts for the target.

Return type:

Tuple

dispel.providers.generic.tasks.pinch.steps.compute_reaction_time(data, reading)[source]#

Compute the reaction time for each target extended with hand and size.

Parameters:
  • data (Series) – The series of targets.

  • reading (Reading) – The associated reading

Returns:

A Series of the reaction time, for each targets.

Return type:

pd.Series

dispel.providers.generic.tasks.pinch.steps.duration_extended(target)[source]#

Extract several parameters from a pinch target.

The parameters extracted are: duration, hand, size, appearance, number of attempts and whether the first attempt was successful.

Parameters:

target (PinchTarget) – A pinch target object.

Returns:

The user duration of the first attempt time in seconds, the hand, the size, the appearance timestamp, the number of attempts for the target and if the first attempt was successful.

Return type:

Tuple

dispel.providers.generic.tasks.pinch.steps.peak_properties(attempt)[source]#

Extract several peak properties from a pinch target.

Parameters:

attempt (PinchAttempt) –

Return type:

Tuple

dispel.providers.generic.tasks.pinch.steps.reaction_time_extended(target)[source]#

Extract reaction time, hand, size and appearance of a target.

The reaction time of the user between the bubble appearance and the first touch event.

Parameters:

target (PinchTarget) – A pinch target object.

Returns:

The user reaction time in ms, the hand, the size, and the appearance timestamp.

Return type:

Tuple