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 (DataStatus) – 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)[source]
Parameters:
  • simulation_time_step_us (int or None) – An explicitly specified time step for the simulation in microseconds. If None, the value is read from the configuration

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

  • min_delay (int, float or None) – new value or None to say use simulation_time_step_ms

shut_down() None[source]

Records that shutdown has been called and clears neuron type limits.

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)[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) – Population to add

Returns:

The first and last global IDs for this Population

Return type:

tuple(int, int)

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)[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) – 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.

Return type:

float

Raises:

SpiNNUtilsException – If the min_delay is currently unavailable

classmethod get_n_populations() int[source]

The number of populations previously added.

Return type:

int

classmethod get_n_projections() int[source]

The number of projections previously added.

rtype: int

classmethod get_segment_counter() int[source]

The number of the current recording segment being generated.

Returns:

the segment counter

Return type:

int

classmethod get_sim_name() str[source]

Gets the name to be returned by pyNN.spiNNaker.name.

Return type:

str

classmethod has_min_delay() bool[source]

Report if there is a minimum supported delay available.

Return type:

bool

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

Return type:

iterable(Population)

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

Return type:

iterable(Projection)

classmethod set_number_of_neurons_per_dimension_per_core(neuron_type: Type[AbstractPyNNModel], max_permitted: Tuple[int, ...] | None)[source]

Sets a ceiling on the number of neurons of a given type that can be placed on a single core for each dimension.

Parameters:
  • neuron_type (type) – neuron type

  • max_permitted (tuple or None) – the number to set to in each dimension