dispel.data.levels module#
A module containing models for levels.
- class dispel.data.levels.Level[source]#
Bases:
Epoch
An entity to separate sub-task inside each test (Levels).
FIXME: DOC
- context#
Contextual information about the level
- measure_set#
A :class:’~dispel.data.measures.MeasureSet’ of a given Level
- Parameters:
id – The identifier of a given Level.
start – The timestamp of the beginning of the level
end – The timestamp of the end of the level
context – Contextual information about the level
raw_data_sets – An iterable of :class:’~dispel.data.raw.RawDataSet’ of a given Level
measure_set – A :class:’~dispel.data.measures.MeasureSet’ of a given Level
epochs – An iterable of
EpochMeasureSet
to be added to the level.
- __init__(id_, start, end, context=None, raw_data_sets=None, measure_set=None, epochs=None)[source]#
- Parameters:
start (Any) –
end (Any) –
context (Context | None) –
raw_data_sets (Iterable[RawDataSet] | None) –
measure_set (MeasureSet | None) –
epochs (Iterable[LevelEpoch] | None) –
- property epochs: List[LevelEpoch]#
Get all epoch measure sets.
- get_raw_data_set(id_)[source]#
Get the raw data set for a given data set id.
- Parameters:
id – The id of the raw data set to be returned
id_ (str) –
- Returns:
The raw data set with the matching id
- Return type:
- Raises:
ValueError – If the given id does not correspond to any existing raw data set within the level.
- property id: LevelId#
Get the ID of the level from its definition.
- Returns:
The ID of the definition provided via definition.
- Return type:
- property raw_data_sets: List[RawDataSet]#
Get all raw data sets.
- class dispel.data.levels.LevelEpoch[source]#
Bases:
Epoch
,MeasureSet
Level specific epoch with measures.
This data model allows to store measures that are specific to a given time point during an evaluation.
- VALUE_CLS#
alias of
LevelEpochMeasureValue
- class dispel.data.levels.LevelEpochMeasureValue[source]#
Bases:
MeasureValue
A measure value for a specific epoch.
- Parameters:
epoch – The epoch for which the measure value was extracted.
- epoch#
The epoch for which the measure value was extracted.
- __init__(epoch, *args, **kwargs)[source]#
- Parameters:
epoch (LevelEpoch) –
- class dispel.data.levels.LevelId[source]#
Bases:
DefinitionId
Match evaluation code with level id.
- Parameters:
modalities – One or several context information on which the
LevelId
is built.
- class dispel.data.levels.Modalities[source]#
Bases:
object
An entity to match level context modalities with a
Level.id
.- Parameters:
mapping – A dict composed of
evaluation_code
and level context information
- get_modalities_from_context(evaluation_code, context)[source]#
Map level contexts to level modalities from an evaluation code.
- property is_default_mode#
Return whether the app version is the default mode.