superneuromat.SNN.delete_neuron#

SNN.delete_neuron(neuron_id: int | Neuron, reindex: bool = True, _delete_synapses: bool = True)[source]#

Deletes a neuron from the network.

Because neurons and synapses are stored in the SNN as lists of parameters, deleting a neuron may cause shifts in the indices of other neurons and synapses. If you are manually modifying the lists of neuron or synapse parameters, you may find it hard to keep track of what’s what.

However, if you use Neurons and Synapses, or NeuronListViews and SynapseListViews, then the shift in indices will be automatically handled, and those objects will reflect the new indices while still referring to the same neurons and synapses that you’d expect.

Parameters:

neuron_id (int or Neuron) – The ID of the neuron to delete.

Returns:

Returns (neuron_mapping, synapse_mapping), where neuron_mapping is a mapping of neuron IDs from {before: after} the neuron was deleted, and synapse_mapping is a mapping of synaptic IDs from {before: after} the neuron was deleted.

Return type:

tuple[dict, dict]