bmtk.simulator.core package#
Subpackages#
- bmtk.simulator.core.modules package
- Submodules
- bmtk.simulator.core.modules.ecephys_module module
- bmtk.simulator.core.modules.iclamp module
- bmtk.simulator.core.modules.simulator_module module
- Module contents
- bmtk.simulator.core.sonata_reader package
- Submodules
- bmtk.simulator.core.sonata_reader.edge_adaptor module
EdgeAdaptor
SonataBaseEdge
SonataBaseEdge.delay
SonataBaseEdge.dynamics_params
SonataBaseEdge.edge_type_id
SonataBaseEdge.is_gap_junction
SonataBaseEdge.model_template
SonataBaseEdge.nsyns
SonataBaseEdge.preselected_targets
SonataBaseEdge.source_node_id
SonataBaseEdge.source_population
SonataBaseEdge.syn_weight()
SonataBaseEdge.target_distance
SonataBaseEdge.target_node_id
SonataBaseEdge.target_population
SonataBaseEdge.target_sections
SonataBaseEdge.weight_function
group_dynamics_params()
no_nsyns()
nsyns()
ret_none_function()
syn_weight()
syn_weight_function()
types_dynamics_params()
weight_function()
- bmtk.simulator.core.sonata_reader.network_reader module
- bmtk.simulator.core.sonata_reader.node_adaptor module
NodeAdaptor
NodeAdaptor.COL_DYNAMICS_PARAM
NodeAdaptor.COL_GID
NodeAdaptor.COL_MODEL_PROCESSING
NodeAdaptor.COL_MODEL_TEMPLATE
NodeAdaptor.COL_MODEL_TYPE
NodeAdaptor.batch_process
NodeAdaptor.create_adaptor()
NodeAdaptor.get_node()
NodeAdaptor.model_processing()
NodeAdaptor.model_template()
NodeAdaptor.model_type()
NodeAdaptor.node_id()
NodeAdaptor.patch_adaptor()
NodeAdaptor.preprocess_node_types()
SonataBaseNode
empty_list()
group_dynamics_params()
none_function()
types_dynamics_params()
- Module contents
Submodules#
bmtk.simulator.core.edge_population module#
bmtk.simulator.core.graph module#
- class bmtk.simulator.core.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 io#
- model_type_col = 'model_type'#
- property node_populations#
bmtk.simulator.core.io_tools module#
- class bmtk.simulator.core.io_tools.IOUtils[source]#
Bases:
object
For logging/mkdir commands we sometimes need to use different MPI classes depending on the simulator being used (NEST and NEURON have their own barrier functions that don’t work well with mpi). We also need to be able to adjust the logging levels/format at run-time depending on the simulator/configuration options.
Thus the bulk of the io and logging functions are put into their own class and can be overwritten by specific simulator modules
- property log_to_console#
- property logger#
bmtk.simulator.core.network_reader module#
bmtk.simulator.core.node_population module#
bmtk.simulator.core.node_sets module#
bmtk.simulator.core.pyfunction_cache module#
- bmtk.simulator.core.pyfunction_cache.add_cell_model(func, directive, model_type='*', overwrite=True)[source]#
- bmtk.simulator.core.pyfunction_cache.cell_model(*wargs, **wkwargs)[source]#
A decorator for registering NEURON cell loader functions.
- bmtk.simulator.core.pyfunction_cache.load_py_modules(cell_models=None, syn_models=None, syn_weights=None, cell_processors=None)[source]#
- bmtk.simulator.core.pyfunction_cache.synapse_model(*wargs, **wkwargs)[source]#
A decorator for registering NEURON synapse loader functions.
- bmtk.simulator.core.pyfunction_cache.synaptic_weight(*wargs, **wkwargs)[source]#
A decorator for registering a function as a synaptic weight function. To use either:
@synaptic_weight def weight_function(): ...
or:
@synaptic_weight(name='name_in_edge_types') def weight_function(): ...
Once the decorator has been attached and imported the functions will automatically be added to py_modules and BMTK will when assigning synaptic/gap junction weights for edges with matching “weight_function” attribute
bmtk.simulator.core.simulation_config module#
- class bmtk.simulator.core.simulation_config.SimulationConfig(*args, **kwargs)[source]#
Bases:
SonataConfig
A special version of SonataConfig that contains some methods that can be used by the simulators. Mainly it contains the build_env() method which can be called to setup logging plus initialize the ‘output_dir’ folder.
Functionality that is specific to SONATA should go in SonataConfig
- build_env(force=False)[source]#
Creates the folder(s) set in ‘output’ section, sets up logging and copies over the configuration
- property io#
- property validator#
bmtk.simulator.core.simulation_config_validator module#
- class bmtk.simulator.core.simulation_config_validator.SimulationConfigValidator(schema, resolver=None, file_formats=(), **kwargs)[source]#
Bases:
Draft4Validator
A JSON Schema validator class that will store a schema (passed into the constructor) and validate a json file. It has all the functionality of the JSONSchema format, plus includes special types and parameters like making sure a value is a file or directory type, checking csv files, etc.
- To Use:
validator = SimConfigValidator(json_schema.json) validator.validate(file.json)
- evolve(**changes)#
- format_checker: FormatChecker | None#
- schema: bool | Mapping[str, Any]#
bmtk.simulator.core.simulator module#
bmtk.simulator.core.simulator_network module#
- class bmtk.simulator.core.simulator_network.SimNetwork[source]#
Bases:
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
- property io#
- property node_populations#
- property py_function_caches#
- property recurrent_edges#