spynnaker.pyNN.models.populations package

Module contents

A population is a group of neurons with the same neuron model and synaptic model, but possibly (usually!) varying connectivity and configuration parameters.

A population view is a subset of a population, created by slicing the population:

view = population[n:m]

An assembly is an agglomeration of populations and population views, created by adding them together:

assembly = population_1 + population_2

Note

sPyNNaker only has incomplete support for assemblies; do not use.

class spynnaker.pyNN.models.populations.Assembly(*populations, **kwargs)[source]

Bases: pyNN.common.populations.Assembly

A group of neurons, may be heterogeneous, in contrast to a Population where all the neurons are of the same type.

Parameters:
  • populations (Population or PopulationView) – the populations or views to form the assembly out of
  • kwargs – may contain label (a string describing the assembly)

Create an Assembly of Populations and/or PopulationViews.

class spynnaker.pyNN.models.populations.IDMixin(population, id)[source]

Bases: object

Instead of storing IDs as integers, we store them as ID objects, which allows a syntax like:

p[3,4].tau_m = 20.0

where p is a Population object.

Parameters:
as_view()[source]

Return a PopulationView containing just this cell.

Return type:PopulationView
celltype
Return type:AbstractPyNNModel
get_initial_value(variable)[source]

Get the initial value of a state variable of the cell.

Parameters:variable (str) – The name of the variable
Return type:float
get_parameters()[source]

Return a dict of all cell parameters.

Return type:dict(str, ..)
id
Return type:int
initialize(**initial_values)[source]

Set the initial value of a state variable of the cell.

inject(current_source)[source]

Inject current from a current source object into the cell.

Parameters:current_source (NeuronCurrentSource) –
is_standard_cell
Return type:bool
local

Whether this cell is local to the current MPI node.

Return type:bool
position

Return the cell position in 3D space. Cell positions are stored in an array in the parent Population, if any, or within the ID object otherwise. Positions are generated the first time they are requested and then cached.

Return type:ndarray
record(variables, to_file=None, sampling_interval=None)[source]

Record the given variable(s) of this cell.

Parameters:
  • variables (str or list(str)) – either a single variable name or a list of variable names. For a given celltype class, celltype.recordable contains a list of variables that can be recorded for that celltype.
  • to_file (neo.io.baseio.BaseIO or str) – If specified, should be a Neo IO instance and write_data() will be automatically called when end() is called.
  • sampling_interval (int) – should be a value in milliseconds, and an integer multiple of the simulation timestep.
set_initial_value(variable, value)[source]

Set the initial value of a state variable of the cell. :param str variable: The name of the variable :param float value: The value of the variable

set_parameters(**parameters)[source]

Set cell parameters, given as a sequence of parameter=value arguments.

class spynnaker.pyNN.models.populations.Population(size, cellclass, cellparams=None, structure=None, initial_values=None, label=None, constraints=None, additional_parameters=None)[source]

Bases: spynnaker.pyNN.models.populations.population_base.PopulationBase

PyNN 0.9 population object.

Parameters:
  • size (int) – The number of neurons in the population
  • cellclass (type or AbstractPyNNModel) – The implementation of the individual neurons.
  • cellparams (dict(str,object) or None) – Parameters to pass to cellclass if it is a class to instantiate. Must be None if cellclass is an instantiated object.
  • structure (BaseStructure) –
  • initial_values (dict(str,float)) – Initial values of state variables
  • label (str) – A label for the population
  • constraints (list(AbstractConstraint)) – Any constraints on how the population is deployed to SpiNNaker.
  • additional_parameters (dict(str, ..)) – Additional parameters to pass to the vertex creation function.
add_placement_constraint(x, y, p=None)[source]

Add a placement constraint

Parameters:
  • x (int) – The x-coordinate of the placement constraint
  • y (int) – The y-coordinate of the placement constraint
  • p (int) – The processor ID of the placement constraint (optional)
all()[source]

Iterator over cell IDs on all MPI nodes.

Return type:iterable(IDMixin)
all_cells
Return type:list(IDMixin)
annotations

The annotations given by the end user

Return type:dict(str, ..)
can_record(variable)[source]

Determine whether variable can be recorded from this population.

Parameters:variable (str) – The variable to answer the question about
Return type:bool
celltype

Implements the PyNN expected celltype property

Returns:The celltype this property has been set to
Return type:AbstractPyNNModel
conductance_based

True if the population uses conductance inputs

Return type:bool
static create(cellclass, cellparams=None, n=1)[source]

Pass through method to the constructor defined by PyNN. Create n cells all of the same type.

Parameters:
Returns:

A New Population

Return type:

Population

describe(template='population_default.txt', engine='default')[source]

Returns a human-readable description of the population.

The output may be customized by specifying a different template together with an associated template engine (see pyNN.descriptions).

If template is None, then a dictionary containing the template context will be returned.

Parameters:
  • template (str) – Template filename
  • engine (str or TemplateEngine or None) – Template substitution engine
Return type:

str or dict

find_units(variable)[source]

Get the units of a variable

Parameters:variable (str) – The name of the variable
Returns:The units of the variable
Return type:str
first_id

The ID of the first member of the population.

Return type:int
get(parameter_names, gather=True, simplify=True)[source]

Get the values of a parameter for every local cell in the population.

Parameters:
  • parameter_names (str or iterable(str)) – Name of parameter. This is either a single string or a list of strings
  • gather (bool) – pointless on sPyNNaker
  • simplify (bool) – ignored
Returns:

A single list of values (or possibly a single value) if paramter_names is a string, or a dict of these if parameter names is a list.

Return type:

str or list(str) or dict(str,str) or dict(str,list(str))

get_data(variables='all', gather=True, clear=False, annotations=None)[source]

Return a Neo Block containing the data (spikes, state variables) recorded from the Assembly.

Parameters:
  • variables (str or list(str)) – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
  • gather (bool) –

    Whether to collect data from all MPI nodes or just the current node.

    Note

    This is irrelevant on sPyNNaker, which always behaves as if this parameter is True.

  • clear (bool) – Whether recorded data will be deleted from the Assembly.
  • annotations (dict(str, ..)) – annotations to put on the neo block
Return type:

Block

Raises:

ConfigurationException – If the variable or variables have not been previously set to record.

get_data_by_indexes(variables, indexes, clear=False, annotations=None)[source]

Return a Neo Block containing the data (spikes, state variables) recorded from the Assembly.

Parameters:
  • variables (str or list(str)) – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
  • indexes (list(int)) – List of neuron indexes to include in the data. Clearly only neurons recording will actually have any data. If None will be taken as all recording as in get_data()
  • clear (bool) – Whether recorded data will be deleted.
  • annotations (dict(str, ..)) – annotations to put on the neo block
Return type:

Block

Raises:

ConfigurationException – If the variable or variables have not been previously set to record.

get_initial_value(variable, selector=None)[source]

Deprecated since version 6.0: Use initial_values() instead.

get_spike_counts(gather=True)[source]

Return the number of spikes for each neuron.

Return type:ndarray
id_to_index(id)[source]

Given the ID(s) of cell(s) in the Population, return its (their) index (order in the Population).

Defined by http://neuralensemble.org/docs/PyNN/reference/populations.html

Parameters:id (int or iterable(int)) –
Return type:int or iterable(int)
id_to_local_index(cell_id)[source]

Given the ID(s) of cell(s) in the Population, return its (their) index (order in the Population), counting only cells on the local MPI node.

Defined by http://neuralensemble.org/docs/PyNN/reference/populations.html

Parameters:cell_id (int or iterable(int)) –
Return type:int or iterable(int)
index_to_id(index)[source]

Given the index (order in the Population) of cell(s) in the Population, return their ID(s)

Parameters:index (int or iterable(int)) –
Return type:int or iterable(int)
initial_values
Return type:dict
initialize(**kwargs)[source]

Set initial values of state variables, e.g. the membrane potential. Values passed to initialize() may be:

  • single numeric values (all neurons set to the same value), or
  • RandomDistribution objects, or
  • lists / arrays of numbers of the same size as the population mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single number.

Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).

Examples:

p.initialize(v=-70.0)
p.initialize(v=rand_distr, gsyn_exc=0.0)
p.initialize(v=lambda i: -65 + i / 10.0)
inject(current_source)[source]

Connect a current source to all cells in the Population.

Defined by http://neuralensemble.org/docs/PyNN/reference/populations.html

label

The label of the population

Return type:str
last_id

The ID of the last member of the population.

Return type:int
local_size

The number of local cells

Defined by http://neuralensemble.org/docs/PyNN/reference/populations.html

mark_no_changes()[source]

Mark this population as not having changes to be mapped.

position_generator
Return type:callable((int), ndarray)
positions

Return the position array for structured populations.

Returns:a 2D array, one row per cell. Each row is three long, for X,Y,Z
Return type:ndarray
record(variables, to_file=None, sampling_interval=None)[source]

Record the specified variable or variables for all cells in the Population or view.

Parameters:
  • variables (str or list(str)) – either a single variable name or a list of variable names. For a given celltype class, celltype.recordable contains a list of variables that can be recorded for that celltype.
  • to_file (io or rawio or str) – a file to automatically record to (optional). write_data() will be automatically called when sim.end() is called.
  • sampling_interval (int) – a value in milliseconds, and an integer multiple of the simulation timestep.
requires_mapping

Whether this population requires mapping.

Return type:bool
sample(n, rng=None)[source]

Randomly sample n cells from the Population, and return a PopulationView object.

Parameters:
  • n (int) – The number of cells to put in the view.
  • rng (NumpyRNG) – The random number generator to use
Return type:

PopulationView

set(**parameters)[source]

Set parameters of this population.

Parameters:parameters – The parameters to set.
set_by_selector(selector, parameter, value=None)[source]

Set one or more parameters for selected cell in the population.

param can be a dict, in which case value should not be supplied, or a string giving the parameter name, in which case value is the parameter value. value can be a numeric value, or list of such (e.g. for setting spike times):

p.set_by_selector(1, "tau_m", 20.0).
p.set_by_selector(1, {'tau_m':20, 'v_rest':-65})
Parameters:
  • selector – See RangedList.set_value_by_selector() as this is just a pass through method
  • parameter (str or dict(str, int or float or list(int) or list(float))) – the parameter to set or dictionary of parameters to set
  • value (int or float or list(int) or list(float)) – the value of the parameter to set.
set_constraint(constraint)[source]

Apply a constraint to a population that restricts the processor onto which its atoms will be placed.

Parameters:constraint (AbstractConstraint) –
set_initial_value(variable, value, selector=None)[source]

Deprecated since version 6.0: Use initialize() instead.

set_mapping_constraint(constraint_dict)[source]

Add a placement constraint - for backwards compatibility

Parameters:constraint_dict (dict(str,int)) – A dictionary containing “x”, “y” and optionally “p” as keys, and ints as values
set_max_atoms_per_core(max_atoms_per_core)[source]

Supports the setting of this population’s max atoms per core

Parameters:max_atoms_per_core (int) – the new value for the max atoms per core.
size

The number of neurons in the population

Return type:int
spinnaker_get_data(variable)[source]

Public accessor for getting data as a numpy array, instead of the neo based object

Parameters:variable (str or list(str)) – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
Returns:array of the data
Return type:ndarray
structure

Return the structure for the population.

Return type:BaseStructure or None
tset(**kwargs)[source]

Deprecated since version 5.0: Use set(parametername=value_array) instead.

write_data(io, variables='all', gather=True, clear=False, annotations=None)[source]

Write recorded data to file, using one of the file formats supported by Neo.

Parameters:
  • io (neo.io.baseio.BaseIO or str) – a Neo IO instance, or a string for where to put a neo instance
  • variables (str or list(str)) – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
  • gather (bool) –

    Whether to bring all relevant data together.

    Note

    SpiNNaker always gathers.

  • clear (bool) – clears the storage data if set to true after reading it back
  • annotations (dict(str, ..)) – annotations to put on the neo block
Raises:

ConfigurationException – If the variable or variables have not been previously set to record.

class spynnaker.pyNN.models.populations.PopulationBase[source]

Bases: object

Shared methods between Populations and PopulationViews.

Mainly pass through and not implemented.

all_cells

An array containing the cell IDs of all neurons in the Population (all MPI nodes).

Return type:list(int)
getSpikes(*args, **kwargs)[source]

Deprecated since version 5.0: Use get_data('spikes') instead.

get_data(variables='all', gather=True, clear=False, annotations=None)[source]

Return a Neo Block containing the data(spikes, state variables) recorded from the Population.

Parameters:
  • variables (str or list(str)) – Either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
  • gather (bool) –

    For parallel simulators, if this is True, all data will be gathered to all nodes and the Neo Block will contain data from all nodes. Otherwise, the Neo Block will contain only data from the cells simulated on the local node.

    Note

    SpiNNaker always gathers.

  • clear (bool) – If this is True, recorded data will be deleted from the Population.
  • annotations (None or dict(str, ..)) – annotations to put on the neo block
Return type:

Block

get_gsyn(*args, **kwargs)[source]

Deprecated since version 5.0: Use get_data(['gsyn_exc', 'gsyn_inh']) instead.

get_spike_counts(gather=True)[source]

Returns a dict containing the number of spikes for each neuron.

The dict keys are neuron IDs, not indices.

Parameters:gather (bool) –

For parallel simulators, if this is True, all data will be gathered to all nodes and the Neo Block will contain data from all nodes. Otherwise, the Neo Block will contain only data from the cells simulated on the local node.

Note

SpiNNaker always gathers.

Return type:dict(int, int)
get_v(*args, **kwargs)[source]

Deprecated since version 5.0: Use get_data('v') instead.

inject(current_source)[source]

Connect a current source to all cells in the Population.

Warning

Currently unimplemented.

Parameters:current_source (pyNN.neuron.standardmodels.electrodes.NeuronCurrentSource) –
is_local(id)[source]

Indicates whether the cell with the given ID exists on the local MPI node.

Return type:bool
local_cells

An array containing the cell IDs of those neurons in the Population that exist on the local MPI node.

Return type:list(int)
local_size

Return the number of cells in the population on the local MPI node.

Return type:int
meanSpikeCount(*args, **kwargs)[source]

Deprecated since version 5.0: Use mean_spike_count() instead.

mean_spike_count(gather=True)[source]

Returns the mean number of spikes per neuron.

Parameters:gather (bool) –

For parallel simulators, if this is True, all data will be gathered to all nodes and the Neo Block will contain data from all nodes. Otherwise, the Neo Block will contain only data from the cells simulated on the local node.

Note

SpiNNaker always gathers.

Return type:float
nearest(position)[source]

Return the neuron closest to the specified position.

Warning

Currently unimplemented.

position_generator

Note

NO PyNN description of this method.

Warning

Currently unimplemented.

positions

Note

NO PyNN description of this method.

Warning

Currently unimplemented.

Return type:ndarray(tuple(float, float, float))
printSpikes(filename, gather=True)[source]

Deprecated since version 5.0: Use write_data(file, 'spikes') instead.

Note

Method signature is the PyNN0.7 one

print_gsyn(filename, gather=True)[source]

Deprecated since version 5.0: Use write_data(file, ['gsyn_exc', 'gsyn_inh']) instead.

Note

Method signature is the PyNN0.7 one

print_v(filename, gather=True)[source]

Deprecated since version 5.0: Use write_data(file, 'v') instead.

Note

Method signature is the PyNN0.7 one

receptor_types()[source]

Note

NO PyNN description of this method.

Warning

Currently unimplemented.

record(variables, to_file=None, sampling_interval=None)[source]

Record the specified variable or variables for all cells in the Population or view.

Parameters:
  • variables (str or list(str)) – either a single variable name or a list of variable names. For a given celltype class, celltype.recordable contains a list of variables that can be recorded for that celltype.
  • to_file (io or rawio or str) – a file to automatically record to (optional). write_data() will be automatically called when end() is called.
  • sampling_interval (int) – a value in milliseconds, and an integer multiple of the simulation timestep.
record_gsyn(sampling_interval=1, to_file=None)[source]

Deprecated since version 5.0: Use record(['gsyn_exc', 'gsyn_inh']) instead.

Note

Method signature is the PyNN 0.7 one with the extra non-PyNN sampling_interval and indexes

record_v(sampling_interval=1, to_file=None)[source]

Deprecated since version 5.0: Use record('v') instead.

Note

Method signature is the PyNN 0.7 one with the extra non-PyNN sampling_interval and indexes

rset(*args, **kwargs)[source]

Deprecated since version 5.0: Use set(parametername=rand_distr) instead.

save_positions(file)[source]

Save positions to file. The output format is index x y z

Warning

Currently unimplemented.

structure

The spatial structure of the parent Population.

Warning

Currently unimplemented.

Return type:BaseStructure
tset(**kwargs)[source]

Deprecated since version 5.0: Use set(parametername=value_array) instead.

write_data(io, variables='all', gather=True, clear=False, annotations=None)[source]

Write recorded data to file, using one of the file formats supported by Neo.

Parameters:
  • io (io or rawio or str) – a Neo IO instance, or a string for where to put a Neo instance
  • variables (str or list(str)) – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
  • gather (bool) –

    For parallel simulators, if this is True, all data will be gathered to all nodes and the Neo Block will contain data from all nodes. Otherwise, the Neo Block will contain only data from the cells simulated on the local node. This is pointless on sPyNNaker.

    Note

    SpiNNaker always gathers.

  • clear (bool) – clears the storage data if set to true after reading it back
  • annotations (None or dict(str, ..)) – annotations to put on the Neo block
class spynnaker.pyNN.models.populations.PopulationView(parent, selector, label=None)[source]

Bases: spynnaker.pyNN.models.populations.population_base.PopulationBase

A view of a subset of neurons within a Population.

In most ways, Populations and PopulationViews have the same behaviour, i.e., they can be recorded, connected with Projections, etc. It should be noted that any changes to neurons in a PopulationView will be reflected in the parent Population and vice versa.

It is possible to have views of views.

Note

Selector to Id is actually handled by AbstractSized.

Parameters:
  • parent (Population or PopulationView) – the population or view to make the view from
  • selector (None or slice or int or list(bool) or list(int) or ndarray(bool) or ndarray(int)) –

    a slice or numpy mask array. The mask array should either be a boolean array (ideally) of the same size as the parent, or an integer array containing cell indices, i.e. if p.size == 5 then:

    PopulationView(p, array([False, False, True, False, True]))
    PopulationView(p, array([2, 4]))
    PopulationView(p, slice(2, 5, 2))
    

    will all create the same view.

  • label (str) – A label for the view
all()[source]

Iterator over cell IDs (on all MPI nodes).

Return type:iterable(IDMixin)
all_cells

An array containing the cell IDs of all neurons in the Population (all MPI nodes).

Return type:list(IDMixin)
can_record(variable)[source]

Determine whether variable can be recorded from this population.

Return type:bool
celltype

The type of neurons making up the underlying Population.

Return type:AbstractPyNNModel
conductance_based

Indicates whether the post-synaptic response is modelled as a change in conductance or a change in current.

Return type:bool
describe(template='populationview_default.txt', engine='default')[source]

Returns a human-readable description of the population view.

The output may be customized by specifying a different template together with an associated template engine (see pyNN.descriptions).

If template is None, then a dictionary containing the template context will be returned.

Parameters:
  • template (str) – Template filename
  • engine (str or TemplateEngine or None) – Template substitution engine
Return type:

str or dict

find_units(variable)[source]

Get the units of a variable

Warning

No PyNN description of this method.

Parameters:variable (str) – The name of the variable
Returns:The units of the variable
Return type:str
get(parameter_names, gather=False, simplify=True)[source]

Get the values of the given parameters for every local cell in the population, or, if gather=True, for all cells in the population.

Values will be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).

Note

SpiNNaker always gathers.

Parameters:
Return type:

iterable(float)

get_data(variables='all', gather=True, clear=False, annotations=None)[source]

Return a Neo Block containing the data(spikes, state variables) recorded from the Population.

Parameters:
  • variables (str or list(str)) – Either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
  • gather (bool) –

    For parallel simulators, if gather is True, all data will be gathered to all nodes and the Neo Block will contain data from all nodes. Otherwise, the Neo Block will contain only data from the cells simulated on the local node.

    Note

    SpiNNaker always gathers.

  • clear (bool) – If True, recorded data will be deleted from the Population.
  • annotations (dict(str, ..)) – annotations to put on the neo block
Return type:

Block

Raises:

ConfigurationException – If the variable or variables have not been previously set to record.

get_spike_counts(gather=True)[source]

Returns a dict containing the number of spikes for each neuron.

The dict keys are neuron IDs, not indices.

Note

Implementation of this method is different to Population as the Populations uses PyNN 7 version of the get_spikes method which does not support indexes.

Parameters:gather (bool) –

Note

SpiNNaker always gathers.

Return type:dict(int,int)
grandparent

Returns the parent Population at the root of the tree (since the immediate parent may itself be a PopulationView).

The name “grandparent” is of course a little misleading, as it could be just the parent, or the great, great, great, …, grandparent.

Return type:Population
id_to_index(id)[source]

Given the ID(s) of cell(s) in the PopulationView, return its / their index / indices(order in the PopulationView).

assert pv.id_to_index(pv[3]) == 3

Parameters:id (int or list(int)) –
Return type:int or list(int)
index_in_grandparent(indices)[source]

Given an array of indices, return the indices in the parent population at the root of the tree.

Parameters:indices (list(int)) –
Return type:list(int)
initial_values

A dict containing the initial values of the state variables.

Return type:dict(str, ..)
initialize(**initial_values)[source]

Set initial values of state variables, e.g. the membrane potential. Values passed to initialize() may be:

  • single numeric values (all neurons set to the same value), or
  • RandomDistribution objects, or
  • lists / arrays of numbers of the same size as the population mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single number.

Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, events per second).

Examples:

p.initialize(v=-70.0)
p.initialize(v=rand_distr, gsyn_exc=0.0)
p.initialize(v=lambda i: -65 + i / 10.0)
label

A label for the Population View.

Return type:str
mask

The selector mask that was used to create this view.

Return type:None or slice or int or list(bool) or list(int) or ndarray(bool) or ndarray(int)
parent

A reference to the parent Population (that this is a view of).

Return type:Population
record(variables, to_file=None, sampling_interval=None)[source]

Record the specified variable or variables for all cells in the Population or view.

Parameters:
  • variables (str or list(str)) – either a single variable name, or a list of variable names, or all to record everything. For a given celltype class, celltype.recordable contains a list of variables that can be recorded for that celltype.
  • to_file (io or rawio or str) – If specified, should be a Neo IO instance and write_data() will be automatically called when sim.end() is called.
  • sampling_interval (int) – should be a value in milliseconds, and an integer multiple of the simulation timestep.
sample(n, rng=None)[source]

Randomly sample n cells from the Population view, and return a new PopulationView object.

Parameters:
  • n (int) – The number of cells to select
  • rng (NumpyRNG) – Random number generator
Return type:

PopulationView

set(**parameters)[source]

Set one or more parameters for every cell in the population. Values passed to set() may be:

  • single values,
  • RandomDistribution objects, or
  • lists / arrays of values of the same size as the population mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single value.

Here, a “single value” may be either a single number or a list / array of numbers (e.g. for spike times).

Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).

Examples:

p.set(tau_m=20.0, v_rest=-65).
p.set(spike_times=[0.3, 0.7, 0.9, 1.4])
p.set(cm=rand_distr, tau_m=lambda i: 10 + i / 10.0)
size

The total number of neurons in the Population View.

Return type:int
write_data(io, variables='all', gather=True, clear=False, annotations=None)[source]

Write recorded data to file, using one of the file formats supported by Neo.

Parameters:
  • io (neo.io.BaseIO or str) – a Neo IO instance or the name of a file to write
  • variables (str or list(str)) – either a single variable name or a list of variable names. These must have been previously recorded, otherwise an Exception will be raised.
  • gather (bool) –

    For parallel simulators, if this is True, all data will be gathered to the master node and a single output file created there. Otherwise, a file will be written on each node, containing only data from the cells simulated on that node.

    Note

    SpiNNaker always gathers.

  • clear (bool) – If this is True, recorded data will be deleted from the Population.
  • annotations (dict(str, ..)) – should be a dict containing simple data types such as numbers and strings. The contents will be written into the output data file as metadata.
Raises:

ConfigurationException – If the variable or variables have not been previously set to record.