spynnaker package

Subpackages

Submodules

spynnaker.spike_checker module

spynnaker.spike_checker.synfire_multiple_lines_spike_checker(spikes: ndarray[tuple[Any, ...], dtype[_ScalarT]], n_neurons: int, lines: int, wrap_around: bool = True) None[source]

Checks that there are the expected number of spike lines

Parameters:
  • spikes – The spikes

  • n_neurons – The number of neurons.

  • lines – Expected number of lines

  • wrap_around – If True the lines will wrap around when reaching the last neuron.

Raises:

Exception – If there is a problem with the data

spynnaker.spike_checker.synfire_spike_checker(spikes: ndarray[tuple[Any, ...], dtype[_ScalarT]] | List[ndarray[tuple[Any, ...], dtype[_ScalarT]]], n_neurons: int) None[source]

Checks the spikes and prints an error file if needed.

Parameters:
  • spikes – The spike data to check.

  • n_neurons – The number of neurons.

Raises:

Exception – If there is a problem with the data

spynnaker.spynnaker_plotting module

Plotting tools to be used together with https://github.com/NeuralEnsemble/PyNN/blob/master/pyNN/utility/plotting.py

class spynnaker.spynnaker_plotting.SpynnakerPanel(*data: List[neo.SpikeTrain] | neo.core.spiketrainlist.SpikeTrainList | neo.AnalogSignal | ndarray[tuple[Any, ...], dtype[_ScalarT]] | neo.Block | neo.Segment, **options: Any)[source]

Bases: object

Represents a single panel in a multi-panel figure.

Compatible with pyNN.utility.plotting.Frame and can be mixed with pyNN.utility.plotting.Panel

Unlike pyNN.utility.plotting.Panel, Spikes are plotted faster, other data is plotted as a heat map.

A panel is a Matplotlib Axes or Subplot instance. A data item may be an AnalogSignal, or a list of SpikeTrains. The Panel will automatically choose an appropriate representation. Multiple data items may be plotted in the same panel.

Valid options are any valid Matplotlib formatting options that should be applied to the Axes/Subplot, plus in addition:

data_labels:

a list of strings of the same length as the number of data items.

line_properties:

a list of dictionaries containing Matplotlib formatting options, of the same length as the number of data items.

Whole Neo Objects can be passed in as long as they contain a single Segment/run and only contain one type of data. Whole Segments can be passed in only if they only contain one type of data.

Parameters:
  • data – One or more data series to be plotted.

  • options – Any additional information.

plot(axes: matplotlib.axes.Axes) None[source]

Plot the Panel’s data in the provided Axes/Subplot instance.

Parameters:

axes – An Axes in a matplotlib figure

spynnaker.spynnaker_plotting.heat_plot_neo(axes: matplotlib.axes.Axes, signal_array: neo.AnalogSignal, label: str = '', **options: Any) None[source]

Plots neurons, times and values into a heat map.

Parameters:
  • axes – An Axes in a matplotlib figure

  • signal_array – Neo Signal array object

  • label – Label for the graph

  • options – plotting options

spynnaker.spynnaker_plotting.heat_plot_numpy(axes: matplotlib.axes.Axes, data: ndarray[tuple[Any, ...], dtype[_ScalarT]], label: str = '', **options: Any) None[source]

Plots neurons, times and values into a heat map.

Parameters:
  • axes – An Axes in a matplotlib figure

  • data – numpy array of values in spynnaker7 format

  • label – Label for the graph

  • options – plotting options

spynnaker.spynnaker_plotting.plot_segment(axes: matplotlib.axes.Axes, segment: neo.Segment, label: str = '', **options: Any) None[source]

Plots a segment into a plot of spikes or a heat map.

If there is more than ode type of Data in the segment options must include the name of the data to plot

Note

Method signature defined by PyNN plotting. This allows mixing of this plotting tool and PyNN’s

Parameters:
  • axes – An Axes in a matplotlib figure

  • segment – Data for one run to plot

  • label – Label for the graph

  • options – plotting options

spynnaker.spynnaker_plotting.plot_spikes_numpy(axes: matplotlib.axes.Axes, spikes: ndarray[tuple[Any, ...], dtype[_ScalarT]], label: str = '', **options: Any) None[source]

Plot all spikes.

Parameters:
  • axes – An Axes in a matplotlib figure

  • spikes – sPyNNaker7 format numpy array of spikes

  • label – Label for the graph

  • options – plotting options

spynnaker.spynnaker_plotting.plot_spiketrains(axes: matplotlib.axes.Axes, spiketrains: List[neo.SpikeTrain] | neo.core.spiketrainlist.SpikeTrainList, label: str = '', **options: Any) None[source]

Plot all spike trains in a Segment in a raster plot.

Parameters:
  • axes – An Axes in a matplotlib figure

  • spiketrains – List of spike times

  • label – Label for the graph

  • options – plotting options

Module contents