#### Previous topic

controllers Package

help Package

# burst Package¶

## base_controller¶

class tvb.interfaces.web.controllers.burst.base_controller.BurstBaseController[source]
fill_default_attributes(template_dictionary, subsection='burst')[source]

## burst_controller¶

Control code for Main-Burst Page.

class tvb.interfaces.web.controllers.burst.burst_controller.BurstController[source]

Controller class for Burst-Pages.

cached_simulator_input_tree[source]

Cache Simulator’s input tree, for performance issues. Anyway, without restart, the introspected tree will not be different on multiple executions. :returns: Simulator’s Input Tree (copy from cache or just loaded)

cancel_or_remove_burst(*a, **b)[source]

Cancel or Remove the burst entity given by burst_id. :returns ‘reset-new’: When currently selected burst was removed. JS will need to reset selection to a new entry :returns ‘canceled’: When current burst was still running and was just stopped. :returns ‘done’: When no action is required on the client.

change_selected_tab(*a, **b)[source]

Set :param tab_nr: as the currently selected tab in the stored burst configuration.

check_status_for_visualizer(*a, **b)[source]

This call is used to check on a regular basis if the data for a certain portlet is available for visualization. Should return the status and the HTML to be displayed.

configure_simulator_parameters(*a, **b)[source]

Return the required input tree to generate the simulator interface for the burst page in ‘configuration mode’, meaning with checkboxes next to each input that are checked or not depending on if the user selected them so, and with the user filled defaults.

copy_burst(*a, **b)[source]

When currently selected entry is a valid Burst, create a clone of that Burst.

export(*a, **b)[source]
get_configured_portlets(*a, **b)[source]

Return the portlets for one given tab. This is used when changing from tab to tab and selecting which portlets will be displayed.

get_history_status(*a, **b)[source]

For each burst id received, get the status and return it.

get_portlet_configurable_interface(*a, **b)[source]

From the position given by the tab index and the index from that tab, get the portlet configuration and build the configurable interface for that portlet.

get_portlet_session_configuration(*a, **b)[source]

Get the current configuration of portlets stored in session for this burst, as a json.

get_previous_selected_rangers(*a, **b)[source]

Retrieve Rangers, if any previously selected in Burst.

get_reduced_simulator_interface(*a, **b)[source]

Get a simulator interface that only contains the inputs that are marked as KEY_PARAMETER_CHECKED in the current session.

get_selected_burst(*a, **b)[source]

Return the burst that is currently stored in session. This is one alternative to ‘chrome-back problem’.

get_selected_portlets(*a, **b)[source]

Get the selected portlets for the loaded burst.

get_visualizers_for_operation_id(*a, **b)[source]

Method called from parameters exploration page in case a burst with a range of parameters for the simulator was launched. :param op_id: the selected operation id from the parameter space exploration. :param width: the width of the right side display :param height: the height of the right side display

Given these parameters first get the workflow to which op_id belongs, then load the portlets from that workflow as the current burst configuration. Width and height are used to get the proper sizes for the visualization iFrames.

index(*a, **b)[source]

Get on burst main page

launch_burst(*a, **b)[source]

Do the actual burst launch, using the configuration saved in current session. :param launch_mode: new/branch/continue :param burst_name: user-given burst name. It can be empty (case in which we will fill with simulation_x) :param data: kwargs for simulation input parameters.

launch_full_visualizer(*a, **b)[source]

Launch the full scale visualizer from a small preview from the burst cockpit.

launch_visualization(*a, **b)[source]

Launch the visualization for this tab and index in tab. The width and height represent the maximum of the inner visualization canvas so that it can fit in the iFrame.

Given a burst id return its running status, weather it was a operation group and the selected tab. This is called when a burst is selected in the history, when returning from a burst config page (model param or noise) and when the status of running simulations is polled. Besides returning these values it updates the session stored burst.

A burst configuration has 2 meanings. It is a staging configuration for a new burst (stored in transients in the session). It is the configuration used to launch a simulation and it’s running status (stored in the db). This method has to merge the two meanings. If the requested burst_id is different from the one held in the session, then the burst config is loaded from the db, discarding any session stored config. If the id is the same then the session config is kept.

Upload Burst from previously exported JSON file

Load the available burst that are stored in the database at this time. This is one alternative to ‘chrome-back problem’.

Load all the visualization steps for this tab. Width and height represent the dimensions of the right side Div, so that we can compute for each iFrame the maximum size it’s visualizer can take.

portlet_tab_display(*a, **b)[source]

When saving a new configuration of tabs, check if any of the old portlets are still present, and if that is the case use their parameters configuration.

For all the new portlets add entries in the burst configuration. Also remove old portlets that are no longer saved.

rename_burst(*a, **b)[source]

Rename the burst given by burst_id, setting it’s new name to burst_name.

reset_burst(*a, **b)[source]

Called when click on “New Burst” entry happens from UI. This will generate an empty new Burst Configuration.

save_parameters(*a, **b)[source]

Save parameters

Parameters: tab_nr – the index of the selected tab index_in_tab – the index of the configured portlet in the selected tab data – the {“portlet_parameters”: json_string} Where json_string is a Jsonified dictionary {“name”: value}, representing the configuration of the current portlet

Having these inputs, current method updated the configuration of the portlet in the corresponding tab position form the burst configuration in session.

save_simulator_configuration(*a, **b)[source]
Parameters: exclude_ranges – should be a boolean value. If it is True than the ranges will be excluded from the simulation parameters.
Data is a dictionary with pairs in one of the forms:
{ ‘simulator_parameters’ : { $name$ : { ‘value’ : $value$, ‘is_disabled’ : true/false } },
‘burstName’: $burst_name} The names for the checkboxes next to the parameter with name$name$is always$name\$_checked Save this dictionary in an easy to process form from which you could rebuild either only the selected entries, or all of the simulator tree with the given default values.

class tvb.interfaces.web.controllers.burst.burst_controller.BurstNameForm(*args, **kw)[source]

Bases: formencode.schema.Schema

Validate Burst name string

Messages

The input must be dict-like (not a %(type)s: %(value)r)
The input must be a string (not a %(type)s: %(value)r)
empty:
missingValue:
Missing value
noneType:
The input must be a string (not None)
notExpected:
The input field %(name)s was not expected.
singleValueExpected:
chained_validators = []
declarative_count = 130
fields = {'burst_name': <All [<UnicodeString object 127 inputEncoding='utf-8' not_empty=True outputEncoding='utf-8'>, <Regex object 128 regex=<_sre.SRE_Pattern object at 0x7f3726b40f50>>]>}
pre_validators = []

## dynamic_model_controller¶

class tvb.interfaces.web.controllers.burst.dynamic_model_controller.Dynamic(model=None, integrator=None)[source]

Bases: object

Groups a model and an integrator.

class tvb.interfaces.web.controllers.burst.dynamic_model_controller.DynamicModelController[source]
KEY_CACHED_DYNAMIC_MODEL = 'cache.DynamicModelController'
dynamic_detail(*a, **b)[source]
fill_default_attributes(param)[source]
get_cached_dynamic(dynamic_gid)[source]

Creating the model per request will be expensive. So we cache it in session. If there is nothing cached it returns the default dynamic.

graph_changed(*a, **b)[source]
index(*a, **b)[source]
integrator_changed(*a, **b)[source]
model_changed(*a, **b)[source]

Resets the phase plane and returns the ui model for the slider area.

parameters_changed(*a, **b)[source]
submit(*a, **b)[source]
trajectories(*a, **b)[source]
class tvb.interfaces.web.controllers.burst.dynamic_model_controller.SessionCache[source]

Bases: object

A simple cache backed by the current cherrypy session. It does not expire it’s contents.

SESSION_KEY = 'session_cache'

## exploration_controller¶

class tvb.interfaces.web.controllers.burst.exploration_controller.ParameterExplorationController[source]

Controller to handle PSE actions.

draw_discrete_exploration(*a, **b)[source]

Create new data for when the user chooses to refresh from the UI.

draw_isocline_exploration(*a, **b)[source]
get_default_pse_viewer(*a, **b)[source]

For a given DataTypeGroup, check first if the discrete PSE is compatible. If this is not the case fallback to the continous PSE viewer. If none are available return: None.

get_metric_matrix(*a, **b)[source]
get_node_matrix(*a, **b)[source]
get_series_array_discrete(*a, **b)[source]

Create new data for when the user chooses to refresh from the UI.

pse_error(*a, **b)[source]

## noise_configuration_controller¶

class tvb.interfaces.web.controllers.burst.noise_configuration_controller.NoiseConfigurationController[source]

Controller class for placing noise parameters in nodes.

static group_noise_array_by_state_var(noise_values, state_vars, number_of_regions)[source]
index(*a, **b)[source]
static init_noise_config_values(model, integrator, connectivity)[source]

Initialize a state var x number of nodes array with noise values.

submit(*a, **b)[source]

Submit noise dispersions :param node_values: A map from state variable names to noise dispersion arrays. Ex {‘V’: [1,2...74]}

## region_model_parameters_controller¶

class tvb.interfaces.web.controllers.burst.region_model_parameters_controller.RegionsModelParametersController[source]

Controller class for placing model parameters in nodes.

index(*a, **b)[source]
no_dynamics_page()[source]
submit_model_parameters(*a, **b)[source]

Collects the model parameters values from all the models used for the connectivity nodes. Assumes that the array indices are consistent with the node order.