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)

Bases: Assembly

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

Parameters:
  • populations – 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(parent: Population | 'PopulationView', selector: Selector, label: str | None = None)

Bases: PopulationView

Implementation of PyNN IDMixin.

Parameters:
  • parent – the population or view to make the view from

  • selector

    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 – A label for the view

as_view() PopulationView[source]
Returns:

A PopulationView containing just this cell.

get_initial_value(variable: str) ParameterHolder[source]

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

Parameters:

variable – The name of the variable

Returns:

The initial value for this variable

get_parameters() ParameterHolder[source]
Returns:

A dict of all cell parameters.

property id: int

The lowest index in this view

property initial_values: ParameterHolder

A dict containing the initial values of the state variables.

property local: bool

Whether this cell is local to the current MPI node.

property position_generator: Callable[[int], ndarray[tuple[Any, ...], dtype[floating]]]

Returns a function to get the position for single id

property positions: ndarray[tuple[Any, ...], dtype[floating]]

The position array for structured populations.

This will be a 3xN array

set_initial_value(variable: str, value: Values) None[source]

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

Parameters:
  • variable – The name of the variable

  • value – The value of the variable

set_parameters(**parameters: Values) None[source]

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

property structure: BaseStructure | None

The spatial structure of the parent Population.

class spynnaker.pyNN.models.populations.Population(size: int | float | None, cellclass: Type[AbstractPyNNModel] | AbstractPyNNModel | PopulationApplicationVertex, cellparams: Dict[str, Any] | None = None, structure: BaseStructure | None = None, initial_values: Dict[str, float] | None = None, label: str | None = None, additional_parameters: Dict[str, Any] | None = None, **additional_kwargs: Dict[str, Any])

Bases: PopulationBase

PyNN population object.

Parameters:
  • size – The number of neurons in the population

  • cellclass – The implementation of the individual neurons.

  • cellparams – Parameters to pass to cellclass if it is a class to instantiate. Must be None if cellclass is an instantiated object.

  • structure

  • initial_values – Initial values of state variables

  • label – A label for the population

  • additional_parameters – Additional parameters to pass to the vertex creation function.

  • additional_kwargs – A nicer way of allowing additional things

add_placement_constraint(x: int, y: int, p: int | None = None) None[source]

Add a placement constraint.

Parameters:
  • x – The x-coordinate of the placement constraint

  • y – The y-coordinate of the placement constraint

  • p – The processor ID of the placement constraint (optional)

Raises:
  • SimulatorRunningException – If sim.run is currently running

  • SimulatorNotSetupException – If called before sim.setup

  • SimulatorShutdownException – If called after sim.end

all() Iterator[PopulationView][source]
Returns:

Iterator over cell IDs on all MPI nodes.

property all_cells: List[IDMixin]

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

property annotations: Dict[str, Any]

The annotations given by the end user.

can_record(variable: str) bool[source]

Determine whether variable can be recorded from this population.

Parameters:

variable – The variable to answer the question about

Returns:

True if the variable can be recorded, False otherwise.

property celltype: AbstractPyNNModel

The Model uses for this population.

property conductance_based: bool

Whether the population uses conductance inputs

static create(cellclass: Type[AbstractPyNNModel] | AbstractPyNNModel | PopulationApplicationVertex, cellparams: Dict[str, Any] | None = None, n: int = 1) Population[source]

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

Parameters:
  • cellclass – see __init__()

  • cellparams – see __init__()

  • n – see __init__() (size parameter)

Returns:

A New Population

property current_values: ParameterHolder

Get the current values of the state variables.

describe(template: str = 'population_default.txt', engine: str | TemplateEngine | None = 'default') str | Dict[str, Any][source]

Returns a human-readable description of the population.

The output may be customised 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 – Template filename

  • engine – Template substitution engine

Returns:

Human-readable description as a string or dict

find_units(variable: str) str[source]

Get the units of a variable.

Parameters:

variable – The name of the variable

Returns:

The units of the variable

property first_id: int

The ID of the first member of the population.

get(parameter_names: Names, gather: bool = True, simplify: bool = True) ParameterHolder[source]

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

Parameters:
  • parameter_names – Name of parameter. This is either a single string or a list of strings

  • gather – Ignored. Purely for PyNN compatibility

  • simplify – Ignored. Purely for PyNN compatibility

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.

get_data(variables: Names = 'all', gather: bool = True, clear: bool = False, *, annotations: Dict[str, Any] | None = None) neo.Block[source]

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

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

  • gather

    Ignored. Purely for PyNN compatibility

    Note

    SpiNNaker always gathers.

  • clear – If this is True, recorded data will be deleted from the Population.

  • annotations – annotations to put on the neo block

Returns:

Data in neo format

Raises:

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

get_spike_counts(gather: bool = True) Dict[int, int][source]

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

The dict keys are neuron IDs, not indices.

Parameters:

gather

Ignored. Purely for PyNN compatibility

Note

SpiNNaker always gathers.

Returns:

A dict containing the number of spikes for each neuron.

id_to_index(id: int) int[source]
id_to_index(id: Iterable[int]) List[int]

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

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

Parameters:

id

Returns:

Index of cell(s) in the Population

id_to_local_index(cell_id: int | Iterable[int]) Never[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 https://neuralensemble.org/docs/PyNN/reference/populations.html

Parameters:

cell_id

index_to_id(index: int) int[source]
index_to_id(index: Iterable[int]) List[int]

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

Parameters:

index

Returns:

The ID(s) of the cell(s) in the Population

property initial_values: ParameterHolder

The initial values of the state variables.

Note

These values will be the same as the values set with the last call to initialize rather than the actual initial values if this call has been made.

initialize(**kwargs: Values) None[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: NeuronCurrentSource) None[source]

Connect a current source to all cells in the Population.

Parameters:

current_source

Connect a current source to all cells in the Population.

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

property label: str

The label of the population.

property last_id: int

The ID of the last member of the population.

property position_generator: Callable[[int], ndarray[tuple[Any, ...], dtype[floating]]]

Returns a function to get the position for single id

property positions: ndarray[tuple[Any, ...], dtype[floating]]

The position array for structured populations.

This will be a 3xN array

record(variables: Names, to_file: IoDest = None, sampling_interval: float | None = None) None[source]

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

Parameters:
  • variables – 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 – a file to automatically record to (optional). write_data() will be automatically called when end() is called.

  • sampling_interval – a value in milliseconds, and an integer multiple of the simulation timestep.

Raises:

ValueError – If neo can not generate an io Class

sample(n: int, rng: NumpyRNG | None = None) PopulationView[source]

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

Parameters:
  • n – The number of cells to put in the view.

  • rng – The random number generator to use

Returns:

A PopulationView over n random cells.

set(**parameters: Values) None[source]

Set one or more parameters for every cell in the population. For example:

p.set(tau_m=20.0).
Parameters:

parameters – The parameters to set and the values to set them to. The type of each parameter depends on the parameter; it’s often a float, but not always.

Raises:
  • SimulatorRunningException – If sim.run is currently running

  • SimulatorNotSetupException – If called before sim.setup

  • SimulatorShutdownException – If called after sim.end

set_max_atoms_per_core(max_atoms_per_core: int | Tuple[int, ...]) None[source]

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

Parameters:

max_atoms_per_core – the new value for the max atoms per dimension per core.

Raises:
  • SimulatorRunningException – If sim.run is currently running

  • SimulatorNotSetupException – If called before sim.setup

  • SimulatorShutdownException – If called after sim.end

set_state(**kwargs: Values) None[source]

Set current values of state variables, e.g. the membrane potential. Values passed to set_state() 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.set_state(v=-70.0)
p.set_state(v=rand_distr, gsyn_exc=0.0)
p.set_state(v=lambda i: -65 + i / 10.0)
property size: int

The number of neurons in the population.

spinnaker_get_data(variable: str, as_matrix: bool = False, view_indexes: Sequence[int] | None = None) ndarray[tuple[Any, ...], dtype[floating]][source]

SsPyNNaker specific method for getting data as a numpy array, instead of the Neo-based object

Parameters:
  • variable – a single variable name.

  • as_matrix – If set True the data is returned as a 2d matrix

  • view_indexes – The indexes for which data should be returned. If None, all data (view_index = data_indexes)

Returns:

array of the data

property structure: BaseStructure | None

The spatial structure of the parent Population.

The structure for the population.

write_data(io: str | BaseIO, variables: Names = 'all', gather: bool = True, clear: bool = False, annotations: Dict[str, Any] | None = None) None[source]

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

Parameters:
  • io – a Neo IO instance, or a string for where to put a Neo instance

  • variables – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.

  • gather

    Ignored. Purely for PyNN compatibility

    Note

    SpiNNaker always gathers.

  • clear – clears the storage data if set to true after reading it back

  • annotations – annotations to put on the Neo block

class spynnaker.pyNN.models.populations.PopulationBase

Bases: object

Shared methods between Populations and PopulationViews.

Mainly pass through and not implemented.

abstract property all_cells: Sequence[IDMixin]

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

abstractmethod get_data(variables: Names = 'all', gather: bool = True, clear: bool = False, *, annotations: Dict[str, Any] | None = None) neo.Block[source]

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

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

  • gather

    Ignored. Purely for PyNN compatibility

    Note

    SpiNNaker always gathers.

  • clear – If this is True, recorded data will be deleted from the Population.

  • annotations – annotations to put on the neo block

Returns:

Data in neo format

Raises:

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

abstractmethod get_spike_counts(gather: bool = True) Dict[int, int][source]

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

The dict keys are neuron IDs, not indices.

Parameters:

gather

Ignored. Purely for PyNN compatibility

Note

SpiNNaker always gathers.

Returns:

A dict containing the number of spikes for each neuron.

inject(current_source: NeuronCurrentSource) None[source]

Connect a current source to all cells in the Population.

Parameters:

current_source

is_local(id: int) bool[source]

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

Returns:

True

property local_cells: Sequence[IDMixin]

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

property local_size: int

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

mean_spike_count(gather: bool = True) float[source]
Parameters:

gather

Ignored. Purely for PyNN compatibility

Note

SpiNNaker always gathers.

Returns:

The mean number of spikes per neuron.

nearest(position: Any) Never[source]

Return the neuron closest to the specified position.

Warning

Currently unimplemented.

abstract property position_generator: Callable[[int], ndarray[tuple[Any, ...], dtype[floating]]]

Returns a function to get the position for single id

abstract property positions: ndarray[tuple[Any, ...], dtype[floating]]

The position array for structured populations.

This will be a 3xN array

receptor_types() Never[source]

Note

NO PyNN description of this method.

Warning

Currently unimplemented.

abstractmethod record(variables: Names, to_file: IoDest = None, sampling_interval: float | None = None) None[source]

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

Parameters:
  • variables – 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 – a file to automatically record to (optional). write_data() will be automatically called when end() is called.

  • sampling_interval – a value in milliseconds, and an integer multiple of the simulation timestep.

Raises:

ValueError – If neo can not generate an io Class

save_positions(file: Any) Never[source]

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

Warning

Currently unimplemented.

abstract property structure: BaseStructure | None

The spatial structure of the parent Population.

abstractmethod write_data(io: str | neo.baseio.BaseIO, variables: Names = 'all', gather: bool = True, clear: bool = False, annotations: Dict[str, Any] | None = None) None[source]

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

Parameters:
  • io – a Neo IO instance, or a string for where to put a Neo instance

  • variables – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.

  • gather

    Ignored. Purely for PyNN compatibility

    Note

    SpiNNaker always gathers.

  • clear – clears the storage data if set to true after reading it back

  • annotations – annotations to put on the Neo block

class spynnaker.pyNN.models.populations.PopulationView(parent: Population | 'PopulationView', selector: Selector, label: str | None = None)

Bases: 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 – the population or view to make the view from

  • selector

    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 – A label for the view

all() Iterator[IDMixin][source]
Returns:

An iterator over cell IDs (on all MPI nodes).

property all_cells: Sequence[IDMixin]

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

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

can_record(variable: str) bool[source]

Determine whether variable can be recorded from this population.

Returns:

True if this variable can be recorded, False otherwise including if the variable is invalid.

property celltype: AbstractPyNNModel

The type of neurons making up the underlying Population.

property conductance_based: bool

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

property current_values: ParameterHolder

A dict containing the current values of the state variables.

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

Returns a human-readable description of the population view.

The output may be customised 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 – Template filename

  • engine – Template substitution engine

Returns:

A human-readable description of the population view.

find_units(variable: str) str[source]

Get the units of a variable

Warning

No PyNN description of this method.

Parameters:

variable – The name of the variable

Returns:

The units of the variable

get(parameter_names: Names, gather: bool = False, simplify: bool = True) ParameterHolder[source]

Get the values of the given parameters 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:
  • parameter_names

  • gather – Ignored. Purely for PyNN compatibility

  • simplify – Ignored. Purely for PyNN compatibility

Returns:

The values of the given parameters for all cell

get_data(variables: Names = 'all', gather: bool = True, clear: bool = False, *, annotations: Dict[str, Any] | None = None) neo.Block[source]

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

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

  • gather

    Ignored. Purely for PyNN compatibility

    Note

    SpiNNaker always gathers.

  • clear – If this is True, recorded data will be deleted from the Population.

  • annotations – annotations to put on the neo block

Returns:

Data in neo format

Raises:

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

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

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

  • gather

    Ignored. Purely for PyNN compatibility

    Note

    SpiNNaker always gathers.

  • clear – If True, recorded data will be deleted from the Population.

  • annotations – annotations to put on the neo block

Raises:

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

get_spike_counts(gather: bool = True) Dict[int, int][source]

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

The dict keys are neuron IDs, not indices.

Parameters:

gather

Ignored. Purely for PyNN compatibility

Note

SpiNNaker always gathers.

Returns:

A dict containing the number of spikes for each neuron.

property grandparent: Population

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.

id_to_index(id: int) int[source]
id_to_index(id: Iterable[int]) List[int]

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

Returns:

Index in this View

index_in_grandparent(indices: Iterable[int]) List[int][source]

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

Parameters:

indices

Returns:

Indices in the parent

property initial_values: ParameterHolder

A dict containing the initial values of the state variables.

initialize(**initial_values: Values) None[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)
inject(current_source: AbstractCurrentSource) None[source]

Connect a current source to all cells in the Population.

Parameters:

current_source

Injects the specified current_source into this PopulationView.

Parameters:

current_source – the current source to be injected

property label: str

A label for the Population View.

property mask: None | int | slice | Sequence[int] | List[bool] | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]]

The selector mask that was used to create this view.

property parent: Population | 'PopulationView'

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

property position_generator: Callable[[int], ndarray[tuple[Any, ...], dtype[floating]]]

Returns a function to get the position for single id

property positions: ndarray[tuple[Any, ...], dtype[floating]]

The position array for structured populations.

This will be a 3xN array

record(variables: Names, to_file: IoDest = None, sampling_interval: float | None = None) None[source]

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

Parameters:
  • variables – 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 – a file to automatically record to (optional). write_data() will be automatically called when end() is called.

  • sampling_interval – a value in milliseconds, and an integer multiple of the simulation timestep.

Raises:

ValueError – If neo can not generate an io Class

sample(n: int, rng: NumpyRNG | None = None) PopulationView[source]

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

Parameters:
  • n – The number of cells to select

  • rng – Random number generator

Returns:

A PopulationView over n random cells.

set(**parameters: Values) None[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)
set_state(**initial_values: Values) None[source]

Set current values of state variables, e.g. the membrane potential. Values passed to set_state() 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.set_state(v=-70.0)
p.set_state(v=rand_distr, gsyn_exc=0.0)
p.set_state(v=lambda i: -65 + i / 10.0)
property size: int

The total number of neurons in the Population View.

spinnaker_get_data(variable: str, as_matrix: bool = False) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]

SsPyNNaker specific method for getting data as a numpy array, instead of the Neo-based object

Parameters:
  • variable – a single variable name

  • as_matrix – If set True the data is returned as a 2d matrix

Returns:

array of the data

property structure: BaseStructure | None

The spatial structure of the parent Population.

write_data(io: str | neo.baseio.BaseIO, variables: Names = 'all', gather: bool = True, clear: bool = False, annotations: Dict[str, Any] | None = None) None[source]

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

Parameters:
  • io – a Neo IO instance, or a string for where to put a Neo instance

  • variables – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.

  • gather

    Ignored. Purely for PyNN compatibility

    Note

    SpiNNaker always gathers.

  • clear – clears the storage data if set to true after reading it back

  • annotations – annotations to put on the Neo block