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

Finger tapping assessment related functionality.

This module contains functionality to extract measures for the Finger tapping assessment.

class dispel.providers.generic.tasks.ft.steps.AggregateDoubleTaps[source]#

Bases: ExtractStep

Count the number of valid taps.

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

An iterable of data sets to be being processed

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

The specification of the measure definition

quantify_double_taps(df)[source]#

Detect double taps.

class dispel.providers.generic.tasks.ft.steps.AggregateTapInterval[source]#

Bases: AggregateRawDataSetColumn

An extraction processing step to extract valid tap interval measures.

__init__(valid_taps=True, **kwargs)[source]#
class dispel.providers.generic.tasks.ft.steps.AggregateTaps[source]#

Bases: AggregateModalities

Compute the patient score for the FT test.

aggregation_method(start=0)#

Return the sum of a ‘start’ value (default: 0) plus an iterable of numbers

When the iterable is empty, return the start value. This function is intended specifically for use with numeric values and may reject non-numeric types.

definition: ValueDefinition | ValueDefinitionPrototype | None = <MeasureValueDefinition: ft-valtap (FT valid tap events)>#

The specification of the measure definition

modalities: List[List[str | AV]] = [[right hand (right)], [left hand (left)], [dominant hand (domhand)], [non dominant hand (nondomhand)]]#

A list of modalities to use for aggregation

class dispel.providers.generic.tasks.ft.steps.ExtractTotalTaps[source]#

Bases: ExtractStep

Count the number of valid taps.

count_valid_taps(data)[source]#

Count the number of valid taps.

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

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.ft.steps.ExtractValidTaps[source]#

Bases: ExtractStep

Count the number of valid taps.

__init__(target, *args, **kwargs)[source]#
Parameters:

target (TappingTarget | None) –

count_valid_taps(data)[source]#

Count the number of valid taps.

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

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.ft.steps.GenericFingerTappingSteps[source]#

Bases: ProcessingStepGroup

Generic measure aggregation step group for finger tapping.

kwargs: Dict[str, Any] = {'task_name': Finger Tapping Assessment (FT)}#
steps: List[ProcessingStep] = [<dispel.providers.generic.tasks.ft.steps.PreprocessingStepGroup object>, <dispel.providers.generic.tasks.ft.steps.MeasureExtractionStepGroup object>, <dispel.providers.generic.tasks.ft.steps.MeasureAggregationStepGroup object>, <dispel.providers.generic.tasks.ft.flags.GenericFlagsStepGroup object>]#
class dispel.providers.generic.tasks.ft.steps.MeasureAggregationStepGroup[source]#

Bases: ProcessingStepGroup

Generic measure aggregation step group for finger tapping.

steps: List[ProcessingStep] = [<dispel.providers.generic.tasks.ft.steps.AggregateTaps object>]#
class dispel.providers.generic.tasks.ft.steps.MeasureExtractionStepGroup[source]#

Bases: ProcessingStepGroup

Generic measure extraction steps for finger tapping.

steps: List[ProcessingStep] = [<dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>]#
class dispel.providers.generic.tasks.ft.steps.PreprocessingStepGroup[source]#

Bases: ProcessingStepGroup

Generic preprocessing steps for finger tapping.

steps: List[ProcessingStep] = [<dispel.providers.generic.tasks.ft.steps.TransformInvalidTaps object>, <dispel.providers.generic.tasks.ft.steps.TransformTapIntervalDistribution object>, <dispel.providers.generic.tasks.ft.steps.TransformTapIntervalDistribution object>]#
class dispel.providers.generic.tasks.ft.steps.TransformInvalidTaps[source]#

Bases: TransformStep

Remove the invalid taps.

The first tap is always valid if it is inside one of the two zones. A left tap is valid if it follows a right tap and vice versa. If a tap event occurs twice or more, then we keep the first event. Generally speaking, this class returns the in-target consecutive tap events being different.

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

An iterable of data sets to be being processed

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: end (end)>, <RawDataValueDefinition: first_position (first_position)>, <RawDataValueDefinition: tap_duration (tap_duration)>, <RawDataValueDefinition: location (location)>]#
static filter_invalid_taps(data)[source]#

Return a filtered version of the tap dataset.

Parameters:

data (DataFrame) –

Return type:

DataFrame

new_data_set_id: str = 'valid_enriched_tap_events_ts'#
class dispel.providers.generic.tasks.ft.steps.TransformTapIntervalDistribution[source]#

Bases: TransformStep

Extract the valid or all tap interval distribution.

__init__(valid_taps=True, **kwargs)[source]#
static extract_tap_distribution(data)[source]#

Return a filtered version of the tap dataset.

Parameters:

data (DataFrame) –

Return type:

DataFrame