bmtk.simulator.utils package¶
Subpackages¶
Submodules¶
bmtk.simulator.utils.config module¶
bmtk.simulator.utils.graph module¶
-
class
bmtk.simulator.utils.graph.
SimEdge
(original_params, dynamics_params)[source]¶ Bases:
object
-
property
edge_type_id
¶
-
property
-
class
bmtk.simulator.utils.graph.
SimGraph
[source]¶ Bases:
object
-
add_component
(key, value)[source]¶ Add a component key-value pair
- Parameters
key – name of component
value – value
-
add_edges
(sonata_file, populations=None, source_pop=None, target_pop=None)[source]¶ - Parameters
sonata_file –
populations –
source_pop –
target_pop –
- Returns
-
add_nodes
(sonata_file, populations=None)[source]¶ Add nodes from a network to the graph.
- Parameters
sonata_file – A NodesFormat type object containing list of nodes.
populations – name/identifier of network. If none will attempt to retrieve from nodes object
-
classmethod
from_config
(conf, **properties)[source]¶ Generates a graph structure from a json config file or dictionary.
- Parameters
conf – name of json config file, or a dictionary with config parameters
properties – optional properties.
- Returns
A graph object of type cls
-
get_component
(key)[source]¶ Get the value of item in the components dictionary.
- Parameters
key – name of component
- Returns
value assigned to component
-
property
internal_pop_names
¶
-
property
io
¶
-
model_type_col
= 'model_type'¶
-
property
node_populations
¶
-
bmtk.simulator.utils.property_maps module¶
bmtk.simulator.utils.simulation_inputs module¶
-
class
bmtk.simulator.utils.simulation_inputs.
SimInput
(input_name, input_type, module, params)[source]¶ Bases:
object
A helper class for parsing the “inputs” section of a SONATA config file. Separate the actual parameters needed to instantiate a module from the metadata parameters (eg, name, module, input_type)
Use the build() method to parse the json/dictionary of a section of input, then params to get a dictionary of the values used to instantiate:
input = SimInput.Build( 'spikes_inputs', {'module': 'spikes', 'input_type': 'hdf5', input_file: 'my_spikes.h5', 'time_scale': 'ms'} ) if input.module == 'spike': SpikesInput(**params) ...
Attributes:
name - str, name of module
input_type - str
module - str,
params - dictionary, all parameters (not including name, input_type, module)
Custom Modules:
Sometimes certain input types may require extra steps in processing, like auto-conversion of filling in missing parameters. In this case use the register module method:
class MyVClampInput(SimInput): def avail_module(): return ['vclamp', 'voltage_clamp'] def build(): .... SimInput.registerModule(MyVClampInput)
Then when SimInput.build() is called and the ‘module_name’==’vclamp’ (or ‘voltage_clamp’) it will pass the parsing to the MyVClampInput class.
-
classmethod
build
(input_name, params)[source]¶ Creates a SimInput object with parsed out parameters
- Parameters
input_name – name of specific input
params – dictionary of input parameters
- Returns
SimInput object, or subclass that matches the specified ‘module’ value
-
property
node_set
¶
-
registry
= {}¶
-
bmtk.simulator.utils.simulation_inputs.
from_config
(cfg)[source]¶ Takes in a bmtk.utils.Config instance and will automatically parse each “input” in the config sections, returning a list of SimInput objects. If an input has “enabled” = False then it will automatically be excluded.
- Parameters
cfg – A SONATAConfig object
- Returns
A list of SimInput modules corresponding to the parsed inputs of a config.
bmtk.simulator.utils.simulation_reports module¶
-
class
bmtk.simulator.utils.simulation_reports.
ClampReport
(report_name, module, params)[source]¶ Bases:
bmtk.simulator.utils.simulation_reports.SimReport
-
property
node_set
¶
-
property
-
class
bmtk.simulator.utils.simulation_reports.
ECPReport
(report_name, module, params)[source]¶ Bases:
bmtk.simulator.utils.simulation_reports.SimReport
-
classmethod
build
(name, params)[source]¶ Factory method to get the module subclass, using the params (particularlly the ‘module’ value, which is required). If there is no registered subclass a generic SimReport object will be returned
- Parameters
report_name – name of report
params – parameters of report
- Returns
A SimReport (or subclass) object with report parameters parsed out.
-
classmethod
-
class
bmtk.simulator.utils.simulation_reports.
MembraneReport
(report_name, module, params)[source]¶ Bases:
bmtk.simulator.utils.simulation_reports.SimReport
,object
-
classmethod
build
(name, params)[source]¶ Factory method to get the module subclass, using the params (particularlly the ‘module’ value, which is required). If there is no registered subclass a generic SimReport object will be returned
- Parameters
report_name – name of report
params – parameters of report
- Returns
A SimReport (or subclass) object with report parameters parsed out.
-
classmethod
-
class
bmtk.simulator.utils.simulation_reports.
MultimeterReport
(report_name, module, params)[source]¶ Bases:
bmtk.simulator.utils.simulation_reports.MembraneReport
-
class
bmtk.simulator.utils.simulation_reports.
NetconReport
(report_name, module, params)[source]¶ Bases:
bmtk.simulator.utils.simulation_reports.MembraneReport
-
class
bmtk.simulator.utils.simulation_reports.
SimReport
(name, module, params)[source]¶ Bases:
object
Used for parsing reports section from a SONATA configuration file. It will take care of implicit and default values.
Use the build() method to convert a “reports” section dictionary to a SimReport object. The SimReport object has properties that can be used to instantiate a simualtion report, particular properties module and params:
report = SimReport.build( report_name='my_report', params = {'module': 'my_mod', ...}) ... MyReport(**report.params)
-
classmethod
build
(report_name, params)[source]¶ Factory method to get the module subclass, using the params (particularlly the ‘module’ value, which is required). If there is no registered subclass a generic SimReport object will be returned
- Parameters
report_name – name of report
params – parameters of report
- Returns
A SimReport (or subclass) object with report parameters parsed out.
-
default_dir
= '.'¶
-
property
node_set
¶
-
registry
= {'SEClamp': <class 'bmtk.simulator.utils.simulation_reports.SEClampReport'>, 'SaveSynapses': <class 'bmtk.simulator.utils.simulation_reports.SaveSynapses'>, 'clamp_report': <class 'bmtk.simulator.utils.simulation_reports.ClampReport'>, 'extracellular': <class 'bmtk.simulator.utils.simulation_reports.ECPReport'>, 'membrane_report': <class 'bmtk.simulator.utils.simulation_reports.MembraneReport'>, 'multimeter': <class 'bmtk.simulator.utils.simulation_reports.MultimeterReport'>, 'multimeter_report': <class 'bmtk.simulator.utils.simulation_reports.MultimeterReport'>, 'netcon_report': <class 'bmtk.simulator.utils.simulation_reports.NetconReport'>, 'spikes_report': <class 'bmtk.simulator.utils.simulation_reports.SpikesReport'>}¶
-
classmethod
-
class
bmtk.simulator.utils.simulation_reports.
SpikesReport
(report_name, module, params)[source]¶ Bases:
bmtk.simulator.utils.simulation_reports.SimReport
-
classmethod
build
(name, params)[source]¶ Factory method to get the module subclass, using the params (particularlly the ‘module’ value, which is required). If there is no registered subclass a generic SimReport object will be returned
- Parameters
report_name – name of report
params – parameters of report
- Returns
A SimReport (or subclass) object with report parameters parsed out.
-
classmethod