bsb_nest package¶
Subpackages¶
- bsb_nest.devices package
- Submodules
- bsb_nest.devices.dc_generator module
- bsb_nest.devices.multimeter module
- bsb_nest.devices.poisson_generator module
- bsb_nest.devices.sinusoidal_poisson_generator module
SinusoidalPoissonGeneratorSinusoidalPoissonGenerator.amplitudeSinusoidalPoissonGenerator.boot()SinusoidalPoissonGenerator.frequencySinusoidalPoissonGenerator.get_node_name()SinusoidalPoissonGenerator.implement()SinusoidalPoissonGenerator.phaseSinusoidalPoissonGenerator.rateSinusoidalPoissonGenerator.startSinusoidalPoissonGenerator.stop
- bsb_nest.devices.spike_recorder module
- Module contents
Submodules¶
bsb_nest.adapter module¶
- class bsb_nest.adapter.NestAdapter(comm=None)¶
Bases:
SimulatorAdapter- Parameters:
comm – The mpi4py MPI communicator to use. Only nodes in the communicator will participate in the simulation. The first node will idle as the main node.
- check_comm()¶
- connect_neurons(simulation)¶
Connect the cells in NEST according to the connection model configurations
- create_neurons(simulation)¶
Create a population of nodes in the NEST simulator based on the cell model configurations.
- load_modules(simulation)¶
- prepare(simulation)¶
Prepare the simulation environment in NEST.
This method initializes internal data structures and performs all setup steps required before running the simulation:
Loads and installs required NEST modules.
Applies simulation-level settings (e.g., resolution, verbosity, seed).
Creates neuron populations based on cell models.
Establishes connectivity between neurons using connection models.
Instantiates devices (e.g., recorders, stimuli) used in the simulation.
If any error occurs during preparation, the corresponding internal state is cleaned up to avoid partial setups.
- Parameters:
simulation (NestSimulation) – The simulation configuration to prepare.
- Returns:
The prepared simulation data associated with the given simulation.
- Return type:
- reset_kernel()¶
- run(*simulations)¶
Fire up the prepared adapter.
- Parameters:
simulations (Simulation) – One or a list of simulation configurations to simulate.
- Returns:
List of simulation results.
- Return type:
- set_settings(simulation: NestSimulation)¶
- Parameters:
simulation (NestSimulation)
- simulate(*simulations, post_prepare=None)¶
Simulate the given simulations.
- Parameters:
simulations (Simulation) – One or a list of simulation configurations to simulate.
post_prepare – Optional callable to run after the simulations’ preparation.
- Returns:
List of simulation results for each simulation run.
- Return type:
- class bsb_nest.adapter.NestResult(simulation)¶
Bases:
SimulationResult- record(nc, **annotations)¶
bsb_nest.cell module¶
- class bsb_nest.cell.NestCell(*args, _parent=None, _key=None, **kwargs)¶
Bases:
CellModel- constants¶
Dictionary of the constants values to assign to the cell model.
- create_population(simdata)¶
- get_node_name()¶
- model¶
Importable reference to the NEST model describing the cell type.
- set_constants(population)¶
- set_parameters(population, simdata)¶
bsb_nest.connection module¶
- class bsb_nest.connection.NestConnectionSettings(*args, _parent=None, _key=None, **kwargs)¶
Bases:
objectClass interfacing a NEST connection rule.
- constants¶
Dictionary of parameters to assign to the connection rule.
- get_node_name()¶
- rule¶
Importable reference to the NEST connection rule used to connect the cells.
- class bsb_nest.connection.NestSynapseSettings(*args, _parent=None, _key=None, **kwargs)¶
Bases:
objectClass interfacing a NEST synapse model.
- constants¶
Dictionary of the constants values to assign to the synapse model.
- delay¶
Delay of the transmission between the presynaptic and the postsynaptic cells.
- get_node_name()¶
- model¶
Importable reference to the NEST model describing the synapse type.
- receptor_type¶
Index of the postsynaptic receptor to target.
- weight¶
Weight of the connection between the presynaptic and the postsynaptic cells.
- class bsb_nest.connection.NestConnection(*args, _parent=None, _key=None, **kwargs)¶
Class interfacing a NEST connection, including its connection rule and synaptic parameters.
- block_iterator(cs, comm)¶
- create_connections(simdata, pre_nodes, post_nodes, cs, comm)¶
- get_conn_spec()¶
- get_connectivity_set()¶
- get_node_name()¶
- get_syn_specs()¶
- local_iterator(cs, comm)¶
- model_strategy: str¶
Specifies the strategy used by the connection model for synapse creation and management.
- predict_mem_iterator(pre_nodes, post_nodes, cs, comm)¶
- synapses¶
List of synapse models to use for a connection.
bsb_nest.device module¶
- class bsb_nest.device.ExtNestDevice(*args, _parent=None, _key=None, **kwargs)¶
Bases:
NestDeviceClass interfacing Nest devices.
- constants¶
Dictionary of the constants values to assign to the device model.
- get_node_name()¶
- implement(adapter, simulation, simdata)¶
Create, connect and register the Nest device.
- Parameters:
adapter (bsb_nest.adapter.NestAdapter)
simulation (bsb_nest.simulation.NestSimulation) – Nest simulation instance
simdata (bsb.simulation.adapter.SimulationData) – Simulation data instance
- nest_model¶
Importable reference to the NEST model describing the device type.
- class bsb_nest.device.NestDevice(*args, _parent=None, _key=None, **kwargs)¶
Bases:
DeviceModel- connect_to_nodes(device, nodes)¶
- delay¶
delay of the transmission between the device and its target
- get_dict_targets(adapter, simulation, simdata) dict¶
Get a dictionary from a target group to its NEST Collection for each target group of the device.
- Parameters:
adapter (bsb_nest.adapter.NestAdapter) – Nest adapter instance
simulation (bsb_nest.simulation.NestSimulation) – Nest simulation instance
simdata (bsb.simulation.adapter.SimulationData) – Simulation data instance
- Returns:
dictionary of device target group to NEST Collection
- Return type:
- get_node_name()¶
- get_target_nodes(adapter, simulation, simdata)¶
Get the NEST Collection of the targets of the device.
- Parameters:
adapter (bsb_nest.adapter.NestAdapter)
simulation (bsb_nest.simulation.NestSimulation) – Nest simulation instance
simdata (bsb.simulation.adapter.SimulationData) – Simulation data instance
- Returns:
Flattened NEST collection with all the targets of the device
- abstractmethod implement(adapter, simulation, simdata)¶
Create, connect and register the Nest device.
- Parameters:
adapter (bsb_nest.adapter.NestAdapter)
simulation (bsb_nest.simulation.NestSimulation) – Nest simulation instance
simdata (bsb.simulation.adapter.SimulationData) – Simulation data instance
- receptor_type¶
Integer ID of the postsynaptic target receptor
- register_device(simdata, device)¶
- targetting¶
Targets of the device, which should be either a population or a nest rule
- weight¶
weight of the connection between the device and its target
- class bsb_nest.device.NestRule(*args, _parent=None, _key=None, **kwargs)¶
Bases:
objectInterface to connect a device directly through the NEST interface.
- cell_models¶
Reference to the Nest cell model to target with the Device
- constants¶
Dictionary of parameters for the targetting rule.
- get_node_name()¶
- rule¶
Connection rule to connect
bsb_nest.distributions module¶
- class bsb_nest.distributions.NestRandomDistribution(*args, _parent=None, _key=None, **kwargs)¶
Bases:
objectClass to handle NEST random distributions.
- get_node_name()¶
- class bsb_nest.distributions.nest_parameter¶
Bases:
TypeHandlerType validator. Type casts the value or node to a Nest parameter, that can be either a value or a NestRandomDistribution.
bsb_nest.exceptions module¶
- exception bsb_nest.exceptions.NestModuleError¶
Bases:
NestKernelError
bsb_nest.simulation module¶
- class bsb_nest.simulation.NestSimulation(*args, _parent=None, _key=None, **kwargs)¶
Bases:
SimulationInterface between the scaffold model and the NEST simulator.
- connection_models: cfgdict[NestConnection]¶
Dictionary of connection models in the simulation.
- devices: cfgdict[NestDevice]¶
Dictionary of devices in the simulation.
- get_node_name()¶
- modules¶
List of NEST modules to load at the beginning of the simulation
- resolution¶
Simulation time step size in milliseconds
- seed¶
Random seed for the simulations
- threads¶
Number of threads to use during simulation
- verbosity¶
NEST verbosity level
Module contents¶
NEST simulation adapter for the BSB framework.