spynnaker.pyNN.data package

Submodules

spynnaker.pyNN.data.spynnaker_data_writer module

class spynnaker.pyNN.data.spynnaker_data_writer.SpynnakerDataWriter(state: DataStatus)[source]

Bases: FecDataWriter, SpynnakerDataView

See UtilsDataWriter.

This class is designed to only be used directly by spinn_front_end_common.interface.abstract_spinnaker_base.AbstractSpinnakerBase and its subclasses and within the PyNN repositories unit tests.

Parameters:

state – State writer should be in

set_up_timings_and_delay(simulation_time_step_us: int | None, time_scale_factor: float | None, min_delay: int | float | None) None[source]

Setup the timings and delays for the simulation

Parameters:
  • simulation_time_step_us – An explicitly specified time step for the simulation in microseconds. If None, the value is read from the configuration

  • time_scale_factor – An explicitly specified time scale factor for the simulation. If None, the value is read from the configuration

  • min_delay – new value or None to say use simulation_time_step_ms

Module contents

class spynnaker.pyNN.data.SpynnakerDataView

Bases: FecDataView

Adds the extra Methods to the View for PyNN level.

See UtilsDataView for a more detailed description.

Use this class wherever possible as it inherits all methods from all View classes.

classmethod add_population(population: Population) Tuple[int, int][source]

Called by each population to add itself to the list.

Usage other than from Population.__init__ is not supported and likely to raise an exception

Increments the all population ID counter by the size of the population.

Parameters:

population – Population to add

Returns:

The first and last global IDs for this Population

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

  • SimulatorNotSetupException – If called before sim.setup

  • SimulatorShutdownException – If called after sim.end

classmethod add_projection(projection: Projection) None[source]

Called by each projection to add itself to the list.

Usage other than from Projection.__init__ is not supported and likely to raise an exception

Parameters:

projection – Projection to add

Raises:

SpiNNUtilsException – If projections should not be added in the current state

classmethod get_min_delay() float[source]

The minimum supported delay if available, in milliseconds.

Typically simulation_time_step_per_ms but may be a positive multiple of it.

Returns:

the minimum delay in milliseconds.

Raises:

SpiNNUtilsException – If the min_delay is currently unavailable

classmethod get_n_populations() int[source]
Returns:

The number of populations previously added.

classmethod get_n_projections() int[source]
Returns:

The number of projections previously added.

classmethod get_sim_name() str[source]
Returns:

The name to be returned by pyNN.spiNNaker.name.

classmethod has_min_delay() bool[source]

Report if there is a minimum supported delay available.

If there is no delay time step could be used.

Returns:

True if get_min_delay method will work

classmethod iterate_populations() Iterator[Population][source]

An iteration of the populations previously added.

The iteration will be empty if no populations added.

Note: This method is backed by a set so does not guarantee order

Returns:

Unordered iterator of Populations

classmethod iterate_projections() Iterator[Projection][source]

An iteration of the projections previously added.

The iteration will be empty if no projections added.

Note: This method is backed by a set so does not guarantee order

Returns:

Unordered iterator of projections.