snnib.brian2_utils

utilities for interactions with brian2

  • functions and classes to make interaction with brian2 objects more straightforward

Exceptions

Classes

Functions
  • get_spike_monitor() – obtains a SpikeMonitor associated with some NeuronGroup

  • get_spiketrain() – obtains plottable spiketrain from some SpikeMonitor

Other Objects

Functions

get_spike_monitor(net, group)

returns the SpikeMonitor associated to group if it exists

get_spiketrains(spike_mon, t_max, n2plot)

returns spiketrains of the first n2plot neurons contained in spike_mon

snnib.brian2_utils.get_spike_monitor(net: Network, group: NeuronGroup) SpikeMonitor[source]

returns the SpikeMonitor associated to group if it exists

  • returns only the first found SpikeMonitor

  • returns None if no SpikeMonitor was found

Parameters
  • net
    • brian2.Network

    • network to hosting group

  • group
    • brian2.NeuronGroup

    • neuron group to get the SpikeMonitor of

Raises

Returns
  • obj
    • SpikeMonitor

    • extracted SpikeMonitor

    • None if no SpikeMonitor was found

Dependencies
  • brian2

  • logging

snnib.brian2_utils.get_spiketrains(spike_mon: SpikeMonitor, t_max: Quantity, n2plot: int)[source]

returns spiketrains of the first n2plot neurons contained in spike_mon

Parameters
  • spike_mon
    • brian2.SpikeMonitor

    • spike monitor containing the spiketrains

  • t_max
    • brian2.Quantity

    • maximum time to extract spiketrains for

  • n2plot
    • int

    • number of neurons to extract spiketrains for

Raises

Returns
  • times
    • np.array[brian2.Quantity]

    • extracted spike times

  • ids
    • np.array

    • ids of the neurons the spiketrains of which have been extracted

Dependencies