The Virtual Brain Project

Table Of Contents

Previous topic

storage Package

Next topic

neocom Package

This Page

transient Package

Entities not persisted are to be defined here.


Entities to be used with an overlay on Operation or DataType, are defined here.

class tvb.core.entities.transient.context_overlay.CommonDetails[source]

Bases: tvb.basic.config.utils.EnhancedDictionary

Enhanced dictionary holding details about an entity. It also contains metadata on how this details will be displayed in UI (disabled/readonly/hidden input field).

CODE_GID = 'gid'
CODE_OPERATION_GROUP_ID = 'operation_group_id'
CODE_OPERATION_GROUP_NAME = 'operation_group_name'
CODE_OPERATION_TAG = 'operation_label'

:param extra_fields_dict a dictionary of fields to be added in a distinct category.

static compute_operation_name(category_name, algorithm_name)[source]

Compute Operation display name, based on Operation Category and Algorithm.

Returns:list of dictionaries to be used for UI display. Each entry in the list will be displayed as a UI group of fields.

A list with all attributes for a DataType which are expected to be submitted from UI.

class tvb.core.entities.transient.context_overlay.DataTypeOverlayDetails[source]

Bases: tvb.core.entities.transient.context_overlay.CommonDetails

Entity used for displaying in an overlay details about a DataType.

DATA_STATE = 'data_state'
DATA_SUBJECT = 'subject'
DATA_TAG_1 = 'datatype_tag_1'
DATA_TAG_2 = 'datatype_tag_2'
DATA_TAG_3 = 'datatype_tag_3'
DATA_TAG_4 = 'datatype_tag_4'
DATA_TAG_5 = 'datatype_tag_5'
DATA_TITLE = 'datatype_title'
fill_from_datatype(datatype_result, parent_burst)[source]

Fill current dictionary with information from a loaded DB DataType. :param datatype_result DB loaded DataType :param parent_burst Burst entity in which current dataType was generated

class tvb.core.entities.transient.context_overlay.OperationOverlayDetails(operation, user_display_name, count_inputs, count_results, burst, no_of_op_in_group, op_pid)[source]

Bases: tvb.core.entities.transient.context_overlay.CommonDetails

Entity used for displaying in an overlay details about an operation.


class tvb.core.entities.transient.range_parameter.RangeParameter(name, type, range_definition, is_array=False, range_values=None)[source]

Bases: builtins.object

static from_json(range_json)[source]


class tvb.core.entities.transient.structure_entities.DataTypeMetaData(data=None, invalid=False)[source]

Bases: tvb.core.entities.transient.structure_entities.GenericMetaData

This object will be populated from meta-data stored on a particular DataType/Operation. It should contain enough information, to restore a DataType entity, without DB previous data required.

KEY_AUTHOR = 'Source_Author'
KEY_BURST = 'Burst_Reference'
KEY_COUNT = 'count'
KEY_CREATE_DATA_DAY = 'createDataDay'
KEY_CREATE_DATA_MONTH = 'createDataMonth'
KEY_DATATYPE_ID = 'Datatypeid'
KEY_DATE = 'Creation_Date'
KEY_FK_OPERATION_GROUP = 'fk_operation_group'
KEY_INVALID = 'datatype_invalid'
KEY_MODULE = 'Module'
KEY_NODE_TYPE = 'DataType'
KEY_OPERATION_ALGORITHM = 'Operation_Algorithm'
KEY_OPERATION_GROUP_NAME = 'op_group_name'
KEY_OPERATION_TAG = 'user_group'
KEY_OPERATION_TYPE = 'Source_Operation_Category'
KEY_OP_GROUP_ID = 'groupId'
KEY_RELEVANCY = 'Relevant'
KEY_STATE = 'Data_State'
KEY_SUBJECT = 'Data_Subject'
KEY_TAG_1 = 'User_Tag_1_Perpetuated'
KEY_TAG_2 = 'User_Tag_2'
KEY_TAG_3 = 'User_Tag_3'
KEY_TAG_4 = 'User_Tag_4'
KEY_TAG_5 = 'User_Tag_5'
KEY_TITLE = 'title'
STATES = {'RAW_DATA': 'Raw Data', 'INTERMEDIATE': 'Intermediate', 'FINAL': 'Final'}

Return the create date of this entity, if stored, or None otherwise.

classmethod get_filterable_meta()[source]

Contains all the attributes by which the user can structure the tree of DataTypes.

All the returned attributes should exists into the ‘data’ field of its corresponding DataTypeMetaData object.


Return the group tag in which the operation was launched


Mark current meta-data as invalid. e.g. Because of a missing associated file.


Update current state, from an external dictionary.


Return the name of the Subject if defined, or Default “John Doe”.

class tvb.core.entities.transient.structure_entities.GenericMetaData(data=None)[source]

Bases: tvb.basic.config.utils.EnhancedDictionary

Wrap a dictionary of meta-data for generic entities - Operations, Project, or DataType.

KEY_FILENAME = 'file_name'
KEY_GID = 'Gid'
Returns:name of the file where to store current data, or None.
Returns:current Global Identifier or None.
class tvb.core.entities.transient.structure_entities.StructureNode(nid, node_name, ntype='Folder', meta=None, children=None)[source]

Bases: builtins.object

This entity represents a node in the Tree of a Project related Structure.

PREFIX_ID_LEAF = 'leaf_'
PREFIX_ID_NODE = 'node_'
SEP = '__'
TYPE_FILE = 'File'
TYPE_FOLDER = 'Folder'
TYPE_INVALID = 'Invalid'

Return TRUE when current node is with Child nodes. Return FALSE when current node is a leaf in Tree.


Check if meta_data has the transient is_link attribute set.


Check that current node is marked as not-relevant.

Check if meta_data has the transient is_link attribute set.

static metadata2tree(metadatas, first_level, second_level, project_id, project_name)[source]

Take a list of DataTypeMetaData entities as input. Create a tree of StructureNode entities, then convert it in JSON to display in UI.

first_level and second_level represents the fields by which should be structured the tree. Those fields should exists into the data dict of each DataTypeMetaData object.


Type of a node it can be FOLDER, FILE or INVALID.