The Virtual Brain Project

Table Of Contents

Previous topic

transient Package

Next topic

project_versions Package

This Page

portlets Package

portlet_configurer

class tvb.core.portlets.portlet_configurer.PortletConfigurer(portlet_entity)[source]

Bases: object

Helper class that handles all the functionality required from a portlet. Given a portlet entity, this will allow the following:

  • return a configurable interface in the form of a dictionary

    equivalent to the input tree of an adapter

  • create a new PortletConfiguration entity, or update a already

    created one with a new set of parameters

algo_identifier[source]

Unique identifier for current portlet.

static build_adapter_from_declaration(adapter_declaration)[source]

Build and adapter from the declaration in the portlets xml.

static clear_data_for_portlet(stored_portlet)[source]

Remove any reference towards a given portlet already selected in a BurstConfiguration.

create_new_portlet_configuration(name='')[source]

Create a PortletConfiguration entity with the default values from the portlet XML declaration and the adapter input trees.

get_configurable_interface()[source]

Given an algorithm identifier, go trough the adapter chain, and merge their input tree with the declared overwrites

log = <logging.Logger object at 0x7f71f5387750>
portlet_id[source]

Portlet DB identifier

prefix_adapters_parameters(adapter_config_list)[source]

Prepend separate prefix to the name of each entry of the adapter interfaces.

Parameters:adapter_config_list – a list of AdapterConfiguration entities.
Returns:same list with the difference that a separate prefix is prepended to the name of each parameter from the adapter interface, specific to the step it is in the adapter chain.
ui_name[source]

Portlet name to be displayed in UI

static update_default_values(portlet_interface, portlet_configuration)[source]
Parameters:
  • portlet_interface – a list of AdapterConfiguration entities.
  • portlet_configuration – a PortletConfiguration entity.

Update the defaults from each AdapterConfiguration entity with the values stored in the corresponding workflow step held in the PortletConfiguration entity.

static update_portlet_configuration(portlet_configuration, submited_parameters)[source]
Parameters:
  • portlet_configuration – the portlet configuration that need to be updated
  • submited_parameters – a list of parameters as submitted from the UI. This All names are prefixed with adapter specific generated prefix.

xml_reader

class tvb.core.portlets.xml_reader.PortletWrapper[source]

Bases: object

Transient model class, used for passing data when reading from XML into portlets memory

get_inputs_dict()[source]

Return only inputs dictionary

to_dict()[source]

Convert into the expected UI tree

class tvb.core.portlets.xml_reader.XMLPortletReader(interface_file)[source]

Bases: object

Helper class to read from XML, a group of Portlets definition.

get_adapters_chain(algorithm_identifier)[source]

Return the list of outputs for a given algorithm

get_algorithms_dictionary()[source]

Retrieve the dictionary of available sub-Algorithm references.

get_inputs(algorithm_identifier)[source]

Return the interface Tree for a single sub-algorithm

logger = <logging.Logger object at 0x7f7214f72050>