Reference Documentation

Cortical System module

class CxSystem.CxSystem(anatomy_and_system_config, physiology_config, output_file_suffix='', instantiated_from_array_run=0, cluster_run_start_idx=-1, cluster_run_step=-1, array_run_in_cluster=0)

The main object of cortical system module for building and running a customized model of cortical module based on the configuration files.

__init__(anatomy_and_system_config, physiology_config, output_file_suffix='', instantiated_from_array_run=0, cluster_run_start_idx=-1, cluster_run_step=-1, array_run_in_cluster=0)

Initialize the cortical system by parsing both of the configuration files.

Parameters:
  • anatomy_and_system_config – could be either the path to the anatomy and system configuration file, or the dataframe containing the configuration data.
  • output_path – could be either the path to the physiology configuration file, or the dataframe containing the configuration data.
  • output_file_suffix – switch the GeNN mode on/off (1/0), by default GeNN is off
  • instantiated_from_array_run – this flag, 0 by default, determines whether this instance of CxSystem is instantiated from another instance of CxSystem which is running an array run.

Main internal variables:

  • customized_neurons_list: This list contains the neuron_reference instances. So for each neuron group target line, there would be an element in this list which contains all the information for that particular neuron group.
  • customized_synapses_list: This list contains the synapse_reference instances. Hence, for each synapse custom line, there would be an element in this list, containing all the necessary information.
  • neurongroups_list: This list contains name of the NeuronGroup() instances that are placed in the Globals().
  • synapses_name_list: This list contains name of the Synapses() instances that are placed in the Globals().
  • monitor_name_bank: The dictionary containing the name of the monitors that are defined for any NeuronGroup() or Synapses().
  • default_monitors: In case –> and <– symbols are used in the configuration file, this default monitor will be applied on all the target lines in between those marks.
  • save_data: The save_data() object for saving the final data.
gather_result()

After the simulation and using the syntaxes that are previously prepared in the syntax_bank of save_data() object, this method saves the collected data to a file.

monitors(mon_args, object_name, equation)

This method creates the Monitors() in brian2 based on the parameters that are extracted from a target line in configuration file.

Parameters:
  • mon_args – The monitor arguments extracted from the target line.
  • object_name – The generated name of the current object.
  • equation – The equation of the NeuronGroup() to check if the target variable exist in it.

Main internal variables:

  • mon_tag: The tag that is extracted from the target line every time.
  • Mon_name: Generated variable name for a specific monitor.
  • Mon_str: The syntax used for building a specific StateMonitor.
  • sub_mon_tags: The tags in configuration file that are specified for a StateMonitor(), e.g. in record=True which is specified by [rec]True in configuration file, [rec] is saved in sub_mon_tags
  • sub_mon_args: The corresponding arguments of sub_mon_tags for a StateMonitor(), e.g. in record=True which is specified by [rec]True in configuration file, True is saved in sub_mon_args.
neuron_group(*args)

The method that creates the NeuronGroups() based on the parameters that are extracted from the configuration file in the __init__ method of the class.

Parameters:args – This method have at least 3 main positional arguments directly passed from the __init__ method: Number of Neurons in the group, Type of neuron in the group and layer index. Description of the layer index as well as other possible arguments can be found in the configuration file tutorial.

Main internal variables:

  • mon_args: contains the monitor arguments extracted from the target line.
  • net_center: center position of the neuron group in visual field coordinates, description can be found in configuration file tutorial.
  • _dyn_neurongroup_name: Generated variable name for the NeuronGroup() object in brian2.
  • _dyn_neuronnumber_name: Generated variable name for corresponding Neuron Number.
  • _dyn_neuron_eq_name: Generated variable name for the NeuronGroup() equation.
  • _dyn_neuron_thres_name: Generated variable name for the NeuronGroup() threshold.
  • _dyn_neuron_reset_name: Generated variable name for the NeuronGroup() reset value.
  • _dyn_neuron_refra_name: Generated variable name for the NeuronGroup() refractory value.
  • _dyn_neuron_namespace_name: Generated variable name for the NeuronGroup() namespace.
  • NG_init: NeuronGroups() should be initialized with a random vm, ge and gi values. To address this, a 6-line code is generated and put in this variable, the running of which will lead to initialization of current NeuronGroup().
relay(*args)

The method that creates the relay NeuronGroups based on the parameters that are extracted from the configuration file in the __init__ method of the class. Note that the SpikeGeneratorGroup() does not support the locations and synaptic connection based on the distance between the input, and the target neuron group. For this reason, a “relay” neuron group is created which is directly connected to the SpikeGeneratorGroup(). Unlike SpikeGeneratorGroup() this relay group supports the locations. With this workaround, the synaptic connection between the input and the Neuron group can be implemented based on the distance of the neurons then.

Note: extracting the input spikes and time sequences for using in a SpikeGeneratorGroup() is done in this method. This procedure needs using a “run()” method in brian2. However, one of the limitations of the Brian2GeNN is that the user cannot use multiple “run()” methods in the whole script. To address this issue, the GeNN device should be set after using the first run(), hence the unusual placement of “set_device(‘genn’)” command in current method.

Note2: The radius of the VPM input is determined based on the Markram et al. 2015: The radius of the system is 210 um and the number of VPM input is 60 (page 19 of supplements). As for the radius of the VPM input, it is mentioned in the paper (page 462) that “neurons were arranged in 310 mini-columns at horizontal positions”. considering the area of the circle with radius of 210um and 60/310 mini-columns, the radius will be equal to 92um.

Parameters:args – This method will have at least 4 main positional arguments directly passed from __init__ method: path to the input .mat file, and the frequency. Description of other possible arguments can be found in Configuration file tutorial.

Main internal variables:

  • inp: an instance of stimuli() object from stimuli module.
  • relay_group: the dictionary containing the data for relay NeuronGroup()
  • _dyn_neurongroup_name: Generated variable name for the NeuronGroup() object in brian2.
  • _dyn_neuronnumber_name: Generated variable name for corresponding Neuron Number.
  • _dyn_neuron_eq_name: Generated variable name for the NeuronGroup() equation.
  • _dyn_neuron_thres_name: Generated variable name for the NeuronGroup() threshold.
  • _dyn_neuron_reset_name: Generated variable name for the NeuronGroup() reset value.
  • SGsyn_name: variable name for the Synapses() object that connects SpikeGeneratorGroup() and relay neurons.

following four variables are build using the load_input_seq() method in stimuli object:

  • spikes_str: The string containing the syntax for Spike indices in the input neuron group.
  • times_str: The string containing the syntax for time indices in the input neuron group.
  • SG_str: The string containing the syntax for creating the SpikeGeneratorGroup() based on the input .mat file.
  • number_of_neurons: The number of neurons that exist in the input .mat file.
synapse(*args)

The method that creates the Synapses() in brian2, based on the parameters that are extracted from the configuration file in the __init__ method of the class.

Parameters:args – This method will have at least 4 main positional arguments directly passed from __init__ method: The receptor, e.g. ge or gi, pre-synaptic NeuronGroup index, post synaptic group index, and type of Synaptic connection , i.e. STDP or Fixed. Description of other possible arguments can be found in Configuration file tutorial.

Main internal variables:

  • mon_args: contains the monitor arguments extracted from the target line.
  • args: normally args contains a set of arguments for a single Synapses() object. However, this changes when the post-synaptic neuron is the first (with index of 0) compartment of a multi-compartmental neuron. In this case, one might intend to target all three sub-compartments, i.e. Basal dendrites, Soma and proximal apical dendrites. So the single set of arguments will be changed to 3 sets of arguments and a for loop will take care of every one of them.
  • dyn_syn_name: Generated variable name for the Synapses() object in brian2.
  • _dyn_syn_eq_name: Generated variable name for the Synapses() equation.
  • _dyn_syn_pre_eq_name: Generated variable name for pre_synaptic equations, i.e. “on_pre=…”
  • _dyn_syn_post_eq_name: Generated variable name for post_synaptic equations, i.e. “on_post= …”
  • _dyn_syn_namespace_name: Generated variable name for the Synapses() namespace.
  • syn_con_str: The string containing the syntax for connect() method of a current Synapses() object. This string changes depending on using the [p] and [n] tags in the configuration file.

Parameter Parser module

class parameter_parser.neuron_parser(output_neuron, physio_config_df)

This class embeds all parameter sets associated to all neuron types and will return it as a namespace in form of dictionary

__init__(output_neuron, physio_config_df)

x.__init__(…) initializes x; see help(type(x)) for signature

class parameter_parser.synapse_parser(output_synapse, physio_config_df)

This class contains all the variables that are required for the Synapses() object namespaces. There are several reference dictionaries in this class for:

  • cw: connection weights for any connection between NeuronGroup()s.
  • sp: Sparseness values for any connection between NeuronGroup()s.
  • STDP: values for A_pre, A_post, Tau_pre and Tau_post for any connection between NeuronGroup()s.
  • dist: distribution of the neurons for connection between NeuronGroup()s.

There are also some important internal variables:

  • Cp: Synaptic potentiation coefficient according to van Rossum J Neurosci 2000
  • Cd: Synaptic depression coefficient according to van Rossum J Neurosci 2000
  • stdp_Nsweeps: 60 in papers one does multiple trials to reach +-50% change in synapse strength. A-coefficient will be divided by this number
  • stdp_max_strength_coefficient: This value is to avoid runaway plasticity.
  • conn_prob_gain: This is used for compensation of small number of neurons and thus incoming synapses
__init__(output_synapse, physio_config_df)

The initialization method for namespaces() object.

Parameters:output_synapse – This is the dictionary created in neuron_reference() in brian2_obj_namespaces module. This contains all the information about the synaptic connection. In this class, Synaptic namespace parameters are directly added to it. Following values are set after initialization: Cp, Cd, sparseness, ilam. Other variables are then set based on the type of the synaptic connection (STDP,Fixed).
Depressing()

Depressing synapse

Facilitating()

Facilitating synapse

Fixed()

The Fixed method for assigning the parameters for Fixed synaptic connection to the customized_synapses() object.

Parameters:output_synapse – This is the dictionary created in neuron_reference() in brian2_obj_namespaces module. This contains all the information about the synaptic connection. In this method, STDP parameters are directly added to this variable. Following STDP values are set in this method: wght_max, wght0.
Fixed_calcium()

The Fixed method for assigning the parameters for Fixed synaptic connection to the customized_synapses() object. This synapse was used in the 1st submitted version, but was later deemed non-valid in terms of calcium scaling

Parameters:output_synapse – This is the dictionary created in neuron_reference() in brian2_obj_namespaces module. This contains all the information about the synaptic connection. In this method, STDP parameters are directly added to this variable. Following STDP values are set in this method: wght_max, wght0.
Fixed_normal()

The Fixed method for assigning the parameters for Fixed synaptic connection to the customized_synapses() object.

Parameters:output_synapse – This is the dictionary created in neuron_reference() in brian2_obj_namespaces module. This contains all the information about the synaptic connection. In this method, STDP parameters are directly added to this variable. Following STDP values are set in this method: wght_max, wght0.
STDP()

The STDP method for assigning the STDP parameters to the customized_synapses() object.

Parameters:output_synapse – This is the dictionary created in neuron_reference() in brian2_obj_namespaces module. This contains all the information about the synaptic connection. In this method, STDP parameters are directly added to this variable. Following STDP values are set in this method: Apre, Apost, Tau_pre, Tau_post, wght_max, wght0.
STDP_with_scaling()

The STDP method for assigning the STDP parameters to the customized_synapses() object.

Parameters:output_synapse – This is the dictionary created in neuron_reference() in brian2_obj_namespaces module. This contains all the information about the synaptic connection. In this method, STDP parameters are directly added to this variable. Following STDP values are set in this method: Apre, Apost, Tau_pre, Tau_post, wght_max, wght0.

Physiology Reference module

class physiology_reference.neuron_reference(idx, number_of_neurons, cell_type, layers_idx, general_grid_radius, min_distance, physio_config_df, network_center=0j)

Using this class, a dictionary object is created which contains all parameters and variables that are needed to create a group of that customized cell. This dictionary will eventually be used in process of building the cortical module. New types of neurons should be implemented in this class.

__init__(idx, number_of_neurons, cell_type, layers_idx, general_grid_radius, min_distance, physio_config_df, network_center=0j)

initialize the neuron_reference based on the arguments.

Parameters:
  • number_of_neurons – number of neurons in the NeuronGroup() object.
  • cell_type – type of cell in the NeuronGroup: currently PC, SS, BC, MC and L1i.
  • layers_idx – indicating the layer in which the cell group is located. In case of SS, BC, MC and L1i it is an integer but for PC which is a multi-compartmental neuron, it is a tuple array. This tuple numpy array defines the first and last layers in which the neuron resides. So array([4,1]) means that the soma resides in layer 4 and the apical dendrites which are (2 compartments) extend to layer 2/3 and 1. To avoid confusion, layer 2 is used as the indicator of layer 2/3. Hence, if the last compartment of a neuron is in layer 2/3, use number 2.
  • network_center – as the name implies, this argument defines the center of teh NeuronGroup() in visual field coordinates. The default value is 0+0j.
  • resolution – resolution for formation of neurons in the grid. Default value is 0.1

Main internal variables:

  • output_neuron: the main dictionary containing all the data about current Customized_neuron_group including: number of neurons, threshold, reset, refractory, neuron type, soma position(layer), dendrites layer, total number of compartments, namespace, equation, positions (both in cortical and visual coordinates).
BC()

This method build up the equation for BC neurons. The final equation is then saved in output_neuron[‘equation’].

  • The equation of the neuron is as follows:

    dvm/dt = (gL*(EL-vm) + gL * DeltaT * exp((vm-VT) / DeltaT) + ge_soma * (Ee-vm) + gi_soma * (Ei-vm)) / C : volt (unless refractory)
    dge_soma/dt = -ge_soma/tau_e : siemens
    dgi_soma/dt = -gi_soma/tau_i : siemens
    x : meter
    y : meter
    
HH_E()

Builds up the equation for excitatory hodgkin huxley neuron. The final equation is then saved in output_neuron[‘equation’].

  • The equation of the neuron is as follows:
dv/dt = (gL*(EL-v)+ge*(Ee-v)+gi*(Ei-v)-g_na*(m*m*m)*h*(v-ENa)-g_kd*(n*n*n*n)*(v-EK))/C : volt
dm/dt = alpha_m*(1-m)-beta_m*m : 1
dn/dt = alpha_n*(1-n)-beta_n*n : 1
dh/dt = alpha_h*(1-h)-beta_h*h : 1
dge/dt = -ge*(1./tau_e) : siemens
dgi/dt = -gi*(1./tau_i) : siemens
alpha_m = 0.32*(mV**-1)*(13*mV-v+VT)/
         (exp((13*mV-v+VT)/(4*mV))-1.)/ms : Hz
beta_m = 0.28*(mV**-1)*(v-VT-40*mV)/
        (exp((v-VT-40*mV)/(5*mV))-1)/ms : Hz
alpha_h = 0.128*exp((17*mV-v+VT)/(18*mV))/ms : Hz
beta_h = 4./(1+exp((40*mV-v+VT)/(5*mV)))/ms : Hz
alpha_n = 0.032*(mV**-1)*(15*mV-v+VT)/
         (exp((15*mV-v+VT)/(5*mV))-1.)/ms : Hz
beta_n = .5*exp((10*mV-v+VT)/(40*mV))/ms : Hz
HH_I()

Builds up the equation for inhibitory hodgkin huxley neuron. The final equation is then saved in output_neuron[‘equation’].

  • The equation of the neuron is as follows:
dv/dt = (gL*(EL-v)+ge*(Ee-v)+gi*(Ei-v)-g_na*(m*m*m)*h*(v-ENa)-g_kd*(n*n*n*n)*(v-EK))/C : volt
dm/dt = alpha_m*(1-m)-beta_m*m : 1
dn/dt = alpha_n*(1-n)-beta_n*n : 1
dh/dt = alpha_h*(1-h)-beta_h*h : 1
dge/dt = -ge*(1./tau_e) : siemens
dgi/dt = -gi*(1./tau_i) : siemens
alpha_m = 0.32*(mV**-1)*(13*mV-v+VT)/
         (exp((13*mV-v+VT)/(4*mV))-1.)/ms : Hz
beta_m = 0.28*(mV**-1)*(v-VT-40*mV)/
        (exp((v-VT-40*mV)/(5*mV))-1)/ms : Hz
alpha_h = 0.128*exp((17*mV-v+VT)/(18*mV))/ms : Hz
beta_h = 4./(1+exp((40*mV-v+VT)/(5*mV)))/ms : Hz
alpha_n = 0.032*(mV**-1)*(15*mV-v+VT)/
         (exp((15*mV-v+VT)/(5*mV))-1.)/ms : Hz
beta_n = .5*exp((10*mV-v+VT)/(40*mV))/ms : Hz
L1i()

This method build up the equation for Layer 1 inhibitory (L1i) neurons. The final equation is then saved in output_neuron[‘equation’].

  • The equation of the neuron is as follows:

    dvm/dt = (gL*(EL-vm) + gL * DeltaT * exp((vm-VT) / DeltaT) + ge_soma * (Ee-vm) + gi_soma * (Ei-vm)) / C : volt (unless refractory)
    dge_soma/dt = -ge_soma/tau_e : siemens
    dgi_soma/dt = -gi_soma/tau_i : siemens
    x : meter
    y : meter
    
MC()

This method build up the equation for MC neurons. The final equation is then saved in output_neuron[‘equation’].

  • The equation of the neuron is as follows:

    dvm/dt = (gL*(EL-vm) + gL * DeltaT * exp((vm-VT) / DeltaT) + ge_soma * (Ee-vm) + gi_soma * (Ei-vm)) / C : volt (unless refractory)
    dge_soma/dt = -ge_soma/tau_e : siemens
    dgi_soma/dt = -gi_soma/tau_i : siemens
    x : meter
    y : meter
    
PC()

This method build up the equation for PC neurons based on the number of compartments. The final equation is then saved in output_neuron[‘equation’].

Main internal variables:

  • eq_template_soma: Contains template somatic equation, the variables in side the equation could be replaced later using “Equation” function in brian2. :

    dvm/dt = (gL*(EL-vm) + gealpha * (Ee-vm) + gealphaX * (Ee-vm) + gialpha * (Ei-vm) + gL * DeltaT * exp((vm-VT) / DeltaT) +I_dendr) / C : volt (unless refractory)
    dge/dt = -ge/tau_e : siemens
    dgealpha/dt = (ge-gealpha)/tau_e : siemens
    dgeX/dt = -geX/tau_eX : siemens
    dgealphaX/dt = (geX-gealphaX)/tau_eX : siemens
    dgi/dt = -gi/tau_i : siemens
    dgialpha/dt = (gi-gialpha)/tau_i : siemens
    x : meter
    y : meter
    
  • eq_template_dend: Contains template dendritic equation:

    dvm/dt = (gL*(EL-vm) + gealpha * (Ee-vm) + gealphaX * (Ee-vm) + gialpha * (Ei-vm) + gL * DeltaT * exp((vm-VT) / DeltaT) +I_dendr) / C : volt (unless refractory)
    dge/dt = -ge/tau_e : siemens
    dgealpha/dt = (ge-gealpha)/tau_e : siemens
    dgeX/dt = -geX/tau_eX : siemens
    dgealphaX/dt = (geX-gealphaX)/tau_eX : siemens
    dgi/dt = -gi/tau_i : siemens
    dgialpha/dt = (gi-gialpha)/tau_i : siemens
    
SS()

This method build up the equation for SS neurons. The final equation is then saved in output_neuron[‘equation’].

  • The equation of the neuron is as follows:

    dvm/dt = (gL*(EL-vm) + gL * DeltaT * exp((vm-VT) / DeltaT) + ge_soma * (Ee-vm) + gi_soma * (Ei-vm)) / C : volt (unless refractory)
    dge_soma/dt = -ge_soma/tau_e : siemens
    dgi_soma/dt = -gi_soma/tau_i : siemens
    x : meter
    y : meter
    
VPM()

This method build up the equation for VPM neurons. No equation is needed.

class physiology_reference.synapse_reference(receptor, pre_group_idx, post_group_idx, syn_type, pre_type, post_type, physio_config_df, post_comp_name='_soma')

In this class, a dictionary object is created which contains all parameters and variables that are needed to create a Synapses() object between two neuron group. This dictionary will eventually be used in process of building the cortical module. New types of synapses should be implemented in this class.

__init__(receptor, pre_group_idx, post_group_idx, syn_type, pre_type, post_type, physio_config_df, post_comp_name='_soma')

initializes the synapse_reference based on its arguments.

Parameters:
  • receptor – defines the type of the receptor in the synaptic connection. Currently ge and gi are implemented.
  • pre_group_idx – The index of the pre-synaptic group.
  • post_group_idx – The index of the post-synaptic group.
  • syn_type – Type of the synaptic connection, currently STDP and Fixed are implemented.
  • pre_type – Type of the pre-synaptic NeuronGroup.
  • post_type – Type of the post-synaptic NeuronGroup.
  • post_comp_name – Name of the target compartment in the cells of the post-synaptic NeuronGroup. The default value is “_soma” as usually soma is being targeted. In case other compartments are targeted in a PC cell, e.g. basal or apical dendrites, _basal or _apical will be used.

Main internal variables:

  • output_synapse: the main dictionary containing all the data about current customized_synapse_group including: synaptic equations (model, pre, post), type of synapse, type of receptor, index and type of pre- and post-synaptic group, namespace for the Synapses() object, sparseness, ilam (?).
  • _name_space: An instance of brian2_obj_namespaces() object which contains all the constant parameters for this synaptic equation.
Fixed()

The method for implementing the Fixed synaptic connection.

Fixed_calcium()

The method for implementing the Fixed synaptic connection.

Fixed_normal()

The method for implementing the Fixed synaptic connection.

STDP()

The method for implementing the STDP synaptic connection.

STDP_with_scaling()

The method for implementing the STDP synaptic connection.

Array_run module

class array_run.array_run(anatomy_system_df, physiology_df, metadata_file_suffx, cluster_start_idx, cluster_step, anat_file_address, physio_file_address, array_run_in_cluster=0)
__init__(anatomy_system_df, physiology_df, metadata_file_suffx, cluster_start_idx, cluster_step, anat_file_address, physio_file_address, array_run_in_cluster=0)

Initialize the array_run for running several instances of CxSystem in parallel.

Parameters:
  • anatomy_system_df – The dataframe containing the anatomical and system configurations that has an instance for array_run in it.
  • physiology_df – The dataframe containing the physiology configurations that has an instance for array_run in it.
  • metadata_file_suffx – The suffix for the metadata file containing the filename and changing parameters in each of the simulations.
arr_run(idx, working, paths)

The function that each spawned process runs and parallel instances of CxSystems are created here.

Parameters:
  • idx – index of the requested parallel CxSystem.
  • working – the index of the process that is being currently performed. This is to keep track of running processes to prevent spawning more than required processes.
  • paths – The path for saving the output of the current instance of CxSystem.
df_builder_for_array_run(original_df, index_of_array_variable, df_type, message='', recursion_counter=1)

Generates new configuration dataframes for each of the scenarios from the original dataframe.

Parameters:
  • original_df – original dataframe.
  • index_of_array_variable – index of the cell with array variable.
  • df_type – type of the dataframe (anatomy_and_system/physiology)
  • message – generated message from previous iteration (when recursion is needed)
  • recursion_counter – counting the iteration (when recursion is needed)
message_finder(df, idx, df_type)

Generates messages for each of the runs in array_run.

Parameters:
  • df – input dataframe.
  • idx – index of the cell based on which the message is going to be generated.
  • df_type – type of dataframe.
spawner(start_idx, steps_from_start)

Spawns processes each dedicated to an instance of CxSystem.

Stimuli module

class stimuli.stimuli(duration, input_mat_path, output_folder, output_file_suffix, output_file_extension)

[Extracted from VCXmodel] This is the stimulation object for applying the input to a particular NeuronGroup(). Currently only video input is supported.

__init__(duration, input_mat_path, output_folder, output_file_suffix, output_file_extension)

Initializes the input module for and instance of CxSystem.

Parameters:
  • duration
  • input_mat_path – .mat file location
  • output_folder – location of the saved output
  • output_file_suffix – suffix for the output file
  • output_file_extension – extension for the output file, i.e. gz, bz2, pickle
calculate_input_seqs()

Calculating input sequence based on the video input.

generate_inputs(freq)

The method for generating input based on the .mat file, using the internal _initialize_inputs() and _calculate_input_seqs() methods.

Parameters:freq – frequency.
get_input_positions()

Extract the positions from the .mat file.

load_input_seq(input_spike_file_location)

Loads spikes from file.

Parameters:input_spike_file_location – Location of the file to load spikes.

Save data module

class save_data.save_data(save_path, datetime_str)

As the name implies, this module is used for gathering the data and saving the result.

__init__(save_path, datetime_str)

Initializes the save_data object.

Parameters:
  • save_path – The path for saving the data.
  • datetime_str – the string containing date and time that is supposed to be unique for each simulation and is used as a suffix for file names.

Main internal variables:

  • data: the main variable to be saved. It contains all the data about the positions of the NeuronGroup()s as well as the monitor results.
  • syntax_bank: Since the monitors are explicitly defined in the Globals(), extracting the data from them requires addressing their name explicitely. To automatize this process, the syntaxes for extracting the data from the target monitors are generated and saved in this variable, so that they can be run at the end of the simulation.
create_key(key)

In case the user wants to save a peculiar variable, this method can be used to check and create a new key in data dictionary (if does not exist).

Parameters:key – name of the key to be created in the final data variable.
gather_result()

Gather the result by running the syntaxes previously saved in the syntax bank before running the simulation.