bmtk.simulator.core package¶
Subpackages¶
Submodules¶
bmtk.simulator.core.edge_population module¶
bmtk.simulator.core.graph module¶
-
class
bmtk.simulator.core.graph.
SimEdge
(original_params, dynamics_params)[source]¶ Bases:
object
-
property
edge_type_id
¶
-
property
-
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
¶
-
property
bmtk.simulator.core.network_reader module¶
bmtk.simulator.core.node_population module¶
bmtk.simulator.core.node_sets module¶
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
-
property
io
¶
-
property
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.create.<locals>.Validator
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
-
property
io
¶
-
property
node_populations
¶
-
property
py_function_caches
¶
-
property
recurrent_edges
¶
-
classmethod