simulator Package

hpc_simulator_adapter

class tvb.adapters.simulator.hpc_simulator_adapter.HPCSimulatorAdapter(storage_path, is_group_launch)[source]

Bases: SimulatorAdapter

extract_operation_data(operation=None)[source]

Do nothing for HPC run. :param operation: None

get_output()[source]
Returns:

list of classes for possible results of the Simulator.

get_storage_path()[source]
launch(view_model: SimulatorAdapterModel) [TimeSeriesIndex, SimulationHistoryIndex][source]
Called from the GUI to launch a simulation.

: string class name of chosen model, etc… *_parameters: dictionary of parameters for chosen model, etc… connectivity: tvb.datatypes.connectivity.Connectivity object. surface: tvb.datatypes.surfaces.CorticalSurface: or None. stimulus: tvb.datatypes.patters. object

load_traited_by_gid(data_gid: UUID) HasTraits[source]

Load a generic HasTraits instance, specified by GID.

load_with_references(dt_gid: UUID | str) HasTraits[source]
path_for(h5_file_class, gid, dt_class=None)[source]
store_complete(datatype, generic_attributes=<tvb.core.entities.generic_attributes.GenericAttributes object>)[source]
class tvb.adapters.simulator.hpc_simulator_adapter.HPCTimeseriesMetricsAdapter(storage_path, input_time_series_index)[source]

Bases: TimeseriesMetricsAdapter

configure(view_model: TimeseriesMetricsAdapterModel) None[source]

Store the input shape to be later used to estimate memory usage.

extract_operation_data(operation=None)[source]

Do nothing for HPC run. :param operation: None

load_traited_by_gid(data_gid: UUID | str) HasTraits[source]

Load a generic HasTraits instance, specified by GID.

path_for(h5_file_class, gid, dt_class=None)[source]
store_complete(datatype, generic_attributes=<tvb.core.entities.generic_attributes.GenericAttributes object>)[source]

range_parameters

class tvb.adapters.simulator.range_parameters.RangeParametersCollector[source]

Bases: object

get_all_range_parameters()[source]

simulator_adapter

Adapter that uses the traits module to generate interfaces to the Simulator. Few supplementary steps are done here:

  • from submitted Monitor/Model… names, build transient entities

  • after UI parameters submit, compose transient Cortex entity to be passed to the Simulator.

class tvb.adapters.simulator.simulator_adapter.SimulatorAdapter[source]

Bases: ABCAdapter

Interface between the Simulator and the Framework.

algorithm = None
branch_simulation_state_gid = None
configure(view_model: SimulatorAdapterModel) None[source]

Make preparations for the adapter launch.

get_adapter_fragments(view_model)[source]

The result will be used for introspecting and checking operation changed input params from the defaults, to show in web gui. :return: a list of ABCAdapterForm classes, in case the current Adapter GUI will be composed of multiple sub-forms.

get_execution_time_approximation(view_model: SimulatorAdapterModel) int[source]

Method should approximate based on input arguments, the time it will take for the operation to finish (in seconds).

get_form_class()[source]
get_output()[source]
Returns:

list of classes for possible results of the Simulator.

get_required_disk_size(view_model: SimulatorAdapterModel) int[source]

Return the required disk size this algorithm estimates it will take. (in kB)

get_required_memory_size(view_model: SimulatorAdapterModel) int[source]

Return the required memory to run this algorithm.

launch(view_model: SimulatorAdapterModel) [TimeSeriesIndex, SimulationHistoryIndex][source]
Called from the GUI to launch a simulation.

: string class name of chosen model, etc… *_parameters: dictionary of parameters for chosen model, etc… connectivity: tvb.datatypes.connectivity.Connectivity object. surface: tvb.datatypes.surfaces.CorticalSurface: or None. stimulus: tvb.datatypes.patters. object

class tvb.adapters.simulator.simulator_adapter.SimulatorAdapterForm[source]

Bases: ABCAdapterForm

fill_from_trait(trait: Simulator) None[source]

Sets data for all traited fields from a trait instance. Note that FormFields are not TraitFields, so this does not work recursively Override to fill in sub-forms

fill_trait(datatype)[source]

Copies the value of the TraitFields to the corresponding Attr-ibutes of the given trait instance Note that FormFields are not TraitFields, so this does not work recursively Override to fill in sub-forms

static get_filters()[source]

Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain

static get_input_name()[source]

The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str

static get_required_datatype()[source]

Each Adapter’s computation is based on a main Datatype. This method should keep the class of it. This Datatype will be stored to DB at introspection time. :return: DataType class

static get_view_model()[source]

Should keep the ViewModel class that corresponds to the current Adapter. :return: ViewModel class