bsb_neuron package

Subpackages

Submodules

bsb_neuron.adapter module

class bsb_neuron.adapter.NeuronAdapter(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.

better_concat(items)
create_connections(simulation)
create_neurons(simulation)
property engine
initial = -65
load_balance(simulation)
prepare(simulation)

Prepare the simulation environment and data structures for running a NEURON simulation.

This method initializes simulation-specific data, sets simulation parameters such as time resolution, temperature, and duration in the NEURON engine, performs load balancing across compute nodes, and creates neurons, connections, and devices according to the simulation configuration.

Parameters:

simulation (bsb.simulation.simulation.Simulation) – The simulation instance to prepare.

Returns:

The prepared simulation data container.

Return type:

NeuronSimulationData

Raises:

Propagates any exceptions raised during preparation, and cleans up partial data on failure.

run(*simulations)
class bsb_neuron.adapter.NeuronPopulation(model, instances: list)

Bases: list

Parameters:

instances (list)

class bsb_neuron.adapter.NeuronResult(simulation)

Bases: SimulationResult

record(obj, **annotations)
class bsb_neuron.adapter.NeuronSimulationData(simulation, result=None)

Bases: SimulationData

type simulation: bsb.simulation.simulation.Simulation

bsb_neuron.adapter.fill_parameter_data(parameters, data)

bsb_neuron.cell module

class bsb_neuron.cell.ArborizeModelTypeHandler(module_path=None)

Bases: object_

class bsb_neuron.cell.ArborizedModel(*args, _parent=None, _key=None, **kwargs)

Bases: NeuronCell

Neuron cell model using Arborize for morphology-based neuron construction.

create(id, pos, morpho, rot, additional)
get_node_name()
model

Configuration attribute specifying the Arborize model type handler.

class bsb_neuron.cell.NeuronCell(*args, _parent=None, _key=None, **kwargs)

Bases: CellModel

Class interfacing a NEURON cell model.

create_instances(count, ids, pos, morpho, rot, additional)

Create multiple neuron cell instances.

Parameters:
  • count (int) – Number of neuron instances to create.

  • ids – Iterable of identifiers for each neuron instance.

  • pos – Iterable of positions for each neuron instance.

  • morpho (bsb.morphologies.MorphologySet) – Iterable of morphology objects.

  • rot (bsb.morphologies.RotationSet) – Iterable of rotation data for each neuron instance.

  • additional – Dict of additional parameters with iterable values.

Returns:

List of created neuron instances.

Return type:

list

get_node_name()
model_strategy: str

The strategy for neuron cell creation (e.g., ‘arborize’).

class bsb_neuron.cell.Shim

Bases: object

class bsb_neuron.cell.ShimModel(*args, _parent=None, _key=None, **kwargs)

Bases: NeuronCell

create(id, pos, morpho, rot, additional)
get_node_name()

bsb_neuron.connection module

class bsb_neuron.connection.NeuronConnection(*args, _parent=None, _key=None, **kwargs)

Bases: ConnectionModel

Class interfacing a NEURON connection.

create_connections(simulation, simdata, connections)

Connect all the cell models with the defined connection models for the provided connectivity set.

get_node_name()
model_strategy: str

The strategy for neuron connection creation (e.g., ‘transceiver’).

class bsb_neuron.connection.SynapseSpec(*args, _parent=None, _key=None, **kwargs)

Bases: object

Class interfacing a NEURON synapse model.

delay

Delay of the transmission between the presynaptic and the postsynaptic cells.

get_node_name()
parameters

List of parameters to assign to the synapse model.

synapse

Name of the synapse model.

weight

Weight of the connection between the presynaptic and the postsynaptic cells.

class bsb_neuron.connection.TransceiverModel(*args, _parent=None, _key=None, **kwargs)

Bases: NeuronConnection

create_connections(simulation, simdata, cs)

Connect all the cell models with the defined connection models for the provided connectivity set.

create_receivers(simdata, cs)
create_transmitters(simdata, cs)
get_node_name()
parameters

List of parameters to assign to the connection.

source

Source variable to assign to the connection.

synapses

List of synapse models to use for a connection.

bsb_neuron.device module

class bsb_neuron.device.NeuronDevice(*args, _parent=None, _key=None, **kwargs)

Bases: DeviceModel

Class representing a NEURON device model.

device: str

The device strategy name.

get_node_name()
targetting

Targets of the device.

bsb_neuron.simulation module

class bsb_neuron.simulation.NeuronSimulation(*args, _parent=None, _key=None, **kwargs)

Bases: Simulation

Interface between the scaffold model and the NEURON simulator.

cell_models: cfgdict[NeuronCell]

Dictionary of cell models in the simulation.

connection_models: cfgdict[NeuronConnection]

Dictionary of connection models in the simulation.

devices: cfgdict[NeuronDevice]

Dictionary of devices in the simulation.

get_node_name()
initial

Initial membrane potential for all neurons.

resolution

Simulation time step size in milliseconds.

temperature

Temperature of the circuit during simulation.

Module contents

NEURON simulator adapter for the BSB framework.