dispel.data.core module#

Core data model for the analysis library.

class dispel.data.core.Evaluation[source]#

Bases: Epoch

Evaluation information for a Reading.

The evaluation corresponds to the json related task, whereas the session corresponds to the group of tasks that the evaluation finds itself in.

FIXME: DOC

uuid#

The unique unified identifier of the evaluation

finished#

True if the concerned task has been finished normally. False otherwise.

exit_reason#

The exit condition. It determines the type of interruption if the test was interrupted, as well as the reason for the end of the test if the test has been completed.

user_id#

The identifier of the user

__init__(*args, uuid, finished=None, exit_reason=None, user_id=None, **kwargs)[source]#
Parameters:
  • uuid (str) –

  • finished (bool | None) –

  • exit_reason (str | None) –

  • user_id (str | None) –

to_dict()[source]#

Retrieve values of evaluation as dictionary.

class dispel.data.core.Reading[source]#

Bases: FlagMixIn

A data capture from an experiment.

evaluation#

The evaluation information for this reading

session#

The session information for this reading

measure_set#

A list of measures already processed on the device

schema#

The schema of the reading

date#

The time the reading was recorded

device#

The device that captured the reading

Parameters:
  • evaluation – The evaluation information for this reading

  • session – The session information for this reading

  • levels – An iterable of Level

  • measure_set – A list of measures already processed on the device

  • schema – The schema of the reading

  • date – The time the reading was recorded

  • device – The device that captured the reading

__init__(evaluation, session=None, levels=None, measure_set=None, schema=None, date=None, device=None)[source]#
Parameters:
property empty: bool#

Check whether the reading is empty.

get_level(level_id=None)[source]#

Get level for a given level_id.

Parameters:

level_id (str | LevelId | None) – The id identifying the level.

Returns:

The level identified by level_id. If no level id is provided and the reading contains only one level it will be returned. Otherwise, the function will raise a ValueError.

Return type:

Level

Raises:
  • ValueError – If the given id does not match any existing level within the reading.

  • ValueError – If no id has been provided, and there are multiple levels withing the reading.

get_measure_set(level_id=None)[source]#

Get measure_set from level identified with level_id.

Parameters:

level_id (str | LevelId | None) –

Return type:

MeasureSet

get_merged_measure_set()[source]#

Get a measure set containing all the reading’s measure values.

Return type:

MeasureSet

get_raw_data_set(data_set_id, level_id)[source]#

Get the raw data set for a given data set id and a level.

Parameters:
  • data_set_id (str) – The id of the raw data set that will be retrieved.

  • level_id (str | LevelId) – The level id from which the raw data set is to retrieved.

Returns:

The raw data set with the matching id.

Return type:

RawDataSet

has_raw_data_set(data_set_id, level_id)[source]#

Check whether the reading contains the desired raw data set.

Parameters:
  • data_set_id (str) – The id of the raw data set that will be searched for.

  • level_id (str | LevelId) – The level id in which the raw data set is to searched for.

Returns:

True if the raw data set exists inside the given level. False otherwise.

Return type:

bool

property level_ids: List[LevelId]#

Get the list of level_id keys.

property levels: ValuesView[Level]#

Get a list of all Level in the reading.

set(value, **kwargs)[source]#
set(value, level=None)
set(value, level=None, epoch=None)
set(value, level, concatenate=False, overwrite=False)
set(value, level)
set(value)
set(value)

Set a value inside a reading.

class dispel.data.core.ReadingSchema[source]#

Bases: object

Schema definition for reading.

__init__(namespace, name, version)#
Parameters:
  • namespace (str) –

  • name (str) –

  • version (str) –

Return type:

None

name: str#

The name of the schema

namespace: str#

The namespace of the schema

version: str#

The version of the schema

class dispel.data.core.Session[source]#

Bases: Epoch

Session information for a Reading.

The session corresponds to the group of tasks that the evaluation finds itself in.

FIXME: DOC

uuid#

The unique unified identifier of the session

evaluation_codes#

An iterable of task types available in the session. Ordered by display order.

__init__(*args, uuid=None, evaluation_codes=None, **kwargs)[source]#
Parameters: