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.
- 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.
- 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:
definition (RawDataSetDefinition) –
data (DataFrame) –
- concat(other)[source]#
Concatenate two raw data sets.
- Parameters:
other (RawDataSet) –
- Return type:
- 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:
id (str) –
source (RawDataSetSource) –
value_definitions_list (dataclasses.InitVar[Iterable[dispel.data.raw.RawDataValueDefinition]]) –
is_computed (bool) –
- Return type:
None
- get_value_definition(id_)[source]#
Get a value definition.
- Parameters:
id_ (DefinitionId) –
- 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.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
.
- dispel.data.raw.USER_ACC_MAP = {'ts': 'ts', 'userAccelerationX': 'x', 'userAccelerationY': 'y', 'userAccelerationZ': 'z'}#
Map user acceleration columns