dispel.providers.bdh.transform module#

Transform module for transform step specific to io format.

The transform step below are steps only modifying a reading coming from a BDH input.

class dispel.providers.bdh.transform.ProcessBDHOnlyMixIn[source]#

Bases: ABC, TransformStep

An abstract class to process only if an instance is a BDH Reading.

process_reading(reading, **kwargs)[source]#

Overwrite process reading.

Parameters:

reading (Reading) –

Return type:

Generator[ProcessingResult | ProcessingControlResult, None, None]

class dispel.providers.bdh.transform.ProcessBDHProcessingStepGroupOnly[source]#

Bases: ABC

An abstract class to process only if an instance is a BDH Reading.

__init__(**kwargs)[source]#
get_kwargs()[source]#

Get keyword arguments to be added to the processing.

Return type:

Dict[str, Any]

process_reading(reading, **kwargs)[source]#

Overwrite process_reading.

Parameters:

reading (Reading) –

Return type:

Generator[ProcessingResult | ProcessingControlResult, None, None]

class dispel.providers.bdh.transform.TruncateBDHVoiceInstructions[source]#

Bases: ProcessBDHOnlyMixIn

Truncate voice instructions in UTT test for BDH format.

For BDH Format, IMUs are recorded during the entire session of SBT-UTT test, even during the voice instructions. To match ADS Format of the UTT and only get IMUs during the actual UTT, the data has to be truncated after the third voice instruction.

get_new_data_set_id()[source]#

Overwrite new_data_set_id with current data_set_id.

Return type:

str

static get_voice_instruction_end(level)[source]#

Get the timestamp at which the voice instructions end.

Parameters:

level (Level) –

Return type:

Timestamp

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

levels (Iterable[Level]) –

Return type:

Set[Level]

truncate(data, level)[source]#

Truncate the data frame removing voice instructions.

Parameters:
class dispel.providers.bdh.transform.TruncateFirstTwoMinBDH[source]#

Bases: ProcessBDHOnlyMixIn

Truncate BDH sensor data to keep only the first two minutes.

Due to the fact the SBT-UTT test does not have a maximum time allowed by Konectom during recording this is to prevent that extremely long recordings are being processed and takes into account only the first two minutes. In practice, this also addresses a Konectom isssue where there is a gap in timestamps in UTT that can span to hours.

get_new_data_set_id()[source]#

Overwrite new_data_set_id with current data_set_id.

Return type:

str

truncate_first_two_minutes(data)[source]#

Truncate the data frame to keep first two minutes.

Parameters:

data (DataFrame) –

class dispel.providers.bdh.transform.TruncateLastThirtySecondsBDH[source]#

Bases: ProcessBDHOnlyMixIn

Truncate BDH sensor data to keep the last 30 seconds.

For BDH Format, IMUs are recorded during the entire session of SBT-UTT test, even during the voice instructions. To match ADS Format of the SBT and only get IMUs during the actual SBT, the data has to be truncated to keep the last 30 seconds.

get_new_data_set_id()[source]#

Overwrite new_data_set_id with current data_set_id.

Return type:

str

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

levels (Iterable[Level]) –

Return type:

Set[Level]

truncate_last_30_seconds(data)[source]#

Truncate the data frame to keep 30 last Seconds.

Parameters:

data (DataFrame) –

class dispel.providers.bdh.transform.TruncateSensorsSBT[source]#

Bases: ProcessingStepGroup

A ProcessingStepGroup concatenating Sensor Truncation steps.

steps: List[ProcessingStep] = [<dispel.providers.bdh.transform.TruncateLastThirtySecondsBDH object>, <dispel.providers.bdh.transform.TruncateLastThirtySecondsBDH object>, <dispel.providers.bdh.transform.TruncateLastThirtySecondsBDH object>]#