dispel.data.raw module#

A module containing models for raw data sets.

dispel.data.raw.ACCELEROMETER_COLUMNS = ['userAccelerationX', 'userAccelerationY', 'userAccelerationZ']#

Column ids of the accelerometer sensor

dispel.data.raw.DEFAULT_COLUMNS = ['x', 'y', 'z']#

Default columns ids for sensors

exception dispel.data.raw.EmptyDataError[source]#

Bases: ValueError

Exception raised when a pandas dataframe is empty.

Parameters:

message – An optional message.

__init__(message=None)[source]#
Parameters:

message (str | None) –

dispel.data.raw.GRAVITY_COLUMNS = ['gravityX', 'gravityY', 'gravityZ']#

Column ids of the gravity sensor

exception dispel.data.raw.MissingColumnError[source]#

Bases: ValueError

Exception raised when a pandas dataframe is missing required column(s).

Parameters:
  • columns – The set of the missing column names.

  • message – An optional message.

__init__(columns, message=None)[source]#
Parameters:
dispel.data.raw.PRESSURE_MAX = 6.666666666666667#

Max pressure in screen measurements

dispel.data.raw.PRESSURE_VALIDATOR = <RangeValidator: [0, 6.666666666666667]>#

A validator for pressure in screen measurements

Parameters:

value (Any) –

class dispel.data.raw.RawDataSet[source]#

Bases: FlagMixIn

A raw data set.

Parameters:
  • definition – The definition of the raw data set

  • data – The data set

__init__(definition, data)[source]#
Parameters:
concat(other)[source]#

Concatenate two raw data sets.

Parameters:

other (RawDataSet) –

Return type:

RawDataSet

property id: str#

Get the identifier from the definition of the raw data set.

class dispel.data.raw.RawDataSetDefinition[source]#

Bases: object

The definition of a raw data set.

__init__(id, source, value_definitions_list, is_computed=False)#
Parameters:
Return type:

None

get_value_definition(id_)[source]#

Get a value definition.

Parameters:

id_ (DefinitionId) –

id: str#

The identifier of the raw data set definition

is_computed: bool = False#

True if the raw data source is computed. False if it is a measured source without transformation, e.g. acceleration recorded from the low level APIs.

source: RawDataSetSource#

The source of the raw data set

property value_definitions#

Get the value definitions of the raw data set.

value_definitions_list: dataclasses.InitVar[Iterable[dispel.data.raw.RawDataValueDefinition]]#
class dispel.data.raw.RawDataSetSource[source]#

Bases: object

The source of a raw data set.

__init__(manufacturer)#
Parameters:

manufacturer (str) –

Return type:

None

manufacturer: str#

The manufacturer producing the raw data set source

class dispel.data.raw.RawDataValueDefinition[source]#

Bases: ValueDefinition

The definition of raw data set values.

is_index#

True if the values are part of the raw data set index. Otherwise, False.

__init__(id_, name, unit=None, description=None, data_type=None, precision=None, is_index=False)[source]#
Parameters:
  • id_ (str) –

  • name (str) –

  • unit (str | None) –

  • description (str | None) –

  • data_type (str | None) –

  • precision (int | None) –

  • is_index (bool) –

class dispel.data.raw.SensorType[source]#

Bases: str, Enum

Abstract class for sensor type.

dispel.data.raw.USER_ACC_MAP = {'ts': 'ts', 'userAccelerationX': 'x', 'userAccelerationY': 'y', 'userAccelerationZ': 'z'}#

Map user acceleration columns