bmtk.simulator.core package¶
Subpackages¶
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
-
io
¶
-
model_type_col
= 'model_type'¶
-
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
-
log_to_console
¶
-
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:
bmtk.utils.sonata.config.sonata_config.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
-
io
¶
-
validator
¶
-
bmtk.simulator.core.simulation_config_validator module¶
-
class
bmtk.simulator.core.simulation_config_validator.
SimulationConfigValidator
(schema, types=(), resolver=None, format_checker=None, file_formats=())[source]¶ Bases:
jsonschema.validators.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)
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
-
io
¶
-
node_populations
¶
-
py_function_caches
¶
-
recurrent_edges
¶
-
classmethod