spynnaker package

Subpackages

Submodules

spynnaker.gsyn_tools module

spynnaker.gsyn_tools.check_gsyn(gsyn1, gsyn2)[source]

Compare two arrays of conductances. For testing.

Parameters:
  • gsyn1 – An array of conductances.

  • gsyn2 – An array of conductances.

Raises:

ValueError – If the arrays differ.

spynnaker.gsyn_tools.check_path_gysn(path, n_neurons, runtime, gsyn)[source]

Compare an arrays of conductances with baseline data from a file. For testing.

Parameters:
  • path – A file path.

  • n_neurons – The number of neurons that produced the data.

  • runtime – The length of time that the generated data represents.

  • gsyn – An array of conductances.

Raises:

ValueError – If the arrays differ.

spynnaker.gsyn_tools.check_sister_gysn(sister, n_neurons, runtime, gsyn)[source]

Compare an arrays of conductances with baseline data from a file next to a specified module. For testing.

Parameters:
  • sister – A module. The file read from will be gsyn.data adjacent to this module.

  • n_neurons – The number of neurons that produced the data.

  • runtime – The length of time that the generated data represents.

  • gsyn – An array of conductances.

Raises:

ValueError – If the arrays differ.

spynnaker.plot_utils module

spynnaker.plot_utils.heat_plot(data_sets, ylabel=None, title=None)[source]

Build a heatmap plot or plots.

Parameters:
  • data_sets (ndarray or list(ndarray)) – Numpy array of data, or list of numpy arrays of data

  • ylabel (str or None) – The label for the Y axis

  • title (str or None) – The title for the plot

spynnaker.plot_utils.line_plot(data_sets, title=None)[source]

Build a line plot or plots.

Parameters:
  • data_sets (ndarray or list(ndarray)) – Numpy array of data, or list of numpy arrays of data

  • title (str or None) – The title for the plot

spynnaker.plot_utils.plot_spikes(spikes, title='spikes')[source]

Build a spike plot or plots.

Parameters:
  • spikes (ndarray or list(ndarray)) – Numpy array of spikes, or list of numpy arrays of spikes

  • title (str) – The title for the plot

spynnaker.spike_checker module

spynnaker.spike_checker.synfire_multiple_lines_spike_checker(spikes, nNeurons, lines, wrap_around=True)[source]

Checks that there are the expected number of spike lines

Parameters:
  • spikes (ndarray or list(ndarray)) – The spikes

  • nNeurons (int) – The number of neurons.

  • lines (int) – Expected number of lines

  • wrap_around (bool) – 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, nNeurons)[source]
Parameters:
  • spikes (ndarray or list(ndarray)) – The spike data to check.

  • nNeurons (int) – 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, **options)[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 heatmap.

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:
plot(axes)[source]

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

Parameters:

axes (Axes) – An Axes in a matplotlib figure

spynnaker.spynnaker_plotting.heat_plot_neo(axes, signal_array, label='', **options)[source]

Plots neurons, times and values into a heatmap.

Parameters:
  • axes (Axes) – An Axes in a matplotlib figure

  • signal_array (AnalogSignal) – Neo Signal array object

  • label (str) – Label for the graph

  • options – plotting options

spynnaker.spynnaker_plotting.heat_plot_numpy(axes, data, label='', **options)[source]

Plots neurons, times and values into a heatmap.

Parameters:
  • axes (Axes) – An Axes in a matplotlib figure

  • data (ndarray) – numpy array of values in spynnaker7 format

  • label (str) – Label for the graph

  • options – plotting options

spynnaker.spynnaker_plotting.plot_segment(axes, segment, label='', **options)[source]

Plots a segment into a plot of spikes or a heatmap.

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 (Axes) – An Axes in a matplotlib figure

  • segment (Segment) – Data for one run to plot

  • label (str) – Label for the graph

  • options – plotting options

spynnaker.spynnaker_plotting.plot_spikes_numpy(axes, spikes, label='', **options)[source]

Plot all spikes.

Parameters:
  • axes (Axes) – An Axes in a matplotlib figure

  • spikes (ndarray) – sPyNNaker7 format numpy array of spikes

  • label (str) – Label for the graph

  • options – plotting options

spynnaker.spynnaker_plotting.plot_spiketrains(axes, spiketrains, label='', **options)[source]

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

Parameters:
  • axes (Axes) – An Axes in a matplotlib figure

  • spiketrains (list(SpikeTrain)) – List of spike times

  • label (str) – Label for the graph

  • options – plotting options

Module contents