spynnaker.pyNN.models.current_sources package

Module contents

class spynnaker.pyNN.models.current_sources.ACSource(start: float = 0.0, stop: float = 0.0, amplitude: float = 0.0, offset: float = 0.0, frequency: float = 0.0, phase: float = 0.0)

Bases: AbstractCurrentSource

AC current source (i.e. sine wave) turned on at “start” and off at “stop”, given (y-)offset, amplitude, frequency and phase.

Parameters:
  • start

  • stop

  • amplitude

  • offset

  • frequency

  • phase

property current_source_id: int

The ID of the current source.

get_sdram_usage_in_bytes() int[source]
Returns:

The SDRAM usage in bytes of the current source.

property parameter_types: Mapping[str, DataType]

The parameter types for the current source.

property parameters: Mapping[str, int | float | Sequence[int] | Sequence[float]]

The parameters of the current source.

set_parameters(**parameters: int | float | Sequence[int] | Sequence[float]) None[source]

Set the current source parameters.

Parameters:

parameters – the parameters to set

class spynnaker.pyNN.models.current_sources.AbstractCurrentSource

Bases: object

A simplified version of the PyNN class, since in most cases we work out the actual offset value on the SpiNNaker machine itself based on the parameters during the run.

property app_vertex: PopulationVertex | None

The application vertex associated with the current source.

abstract property current_source_id: int

The ID of the current source.

abstractmethod get_sdram_usage_in_bytes() int[source]
Returns:

The SDRAM usage in bytes of the current source.

inject_into(cells: PopulationBase) None[source]

Inject this source into the specified population cells.

Parameters:

cells – The cells to inject the source into

abstract property parameter_types: Mapping[str, DataType]

The parameter types for the current source.

abstract property parameters: Mapping[str, int | float | Sequence[int] | Sequence[float]]

The parameters of the current source.

property population: Population | None

The population associated with the current source.

set_app_vertex(vertex: PopulationVertex) None[source]

Set the application vertex associated with the current source.

Parameters:

vertex – The population vertex

abstractmethod set_parameters(**parameters: int | float | Sequence[int] | Sequence[float]) None[source]

Set the current source parameters.

Parameters:

parameters – the parameters to set

set_population(population: Population) None[source]

Set the population associated with the current source.

Parameters:

population

class spynnaker.pyNN.models.current_sources.CurrentSourceIDs(value)

Bases: Enum

Hashes of the current sources currently supported

AC_SOURCE = 2
DC_SOURCE = 1
NOISY_CURRENT_SOURCE = 4
NO_SOURCE = 0
N_SOURCES = 4
STEP_CURRENT_SOURCE = 3
class spynnaker.pyNN.models.current_sources.DCSource(amplitude: float = 0.0, start: float = 0.0, stop: float = 0.0)

Bases: AbstractCurrentSource

Current source with amplitude turned on at “start” and off at “stop”.

Parameters:
  • amplitude

  • start

  • stop

property current_source_id: int

The ID of the current source.

get_sdram_usage_in_bytes() int[source]
Returns:

The SDRAM usage in bytes of the current source.

property parameter_types: Mapping[str, DataType]

The parameter types for the current source.

property parameters: Mapping[str, int | float | Sequence[int] | Sequence[float]]

The parameters of the current source.

set_parameters(**parameters: int | float | Sequence[int] | Sequence[float]) None[source]

Set the current source parameters.

Parameters:

parameters – the parameters to set

class spynnaker.pyNN.models.current_sources.NoisyCurrentSource(mean: float = 0.0, stdev: float = 0.0, start: float = 0.0, stop: float = 0.0, dt: float = 1.0, rng: None = None)

Bases: AbstractCurrentSource

A noisy current source beginning at “start” and ending at “stop”, with noise simulated based on the given mean and standard deviation, and updating every dt (dt should default to the machine time step).

Parameters:
  • mean

  • stdev

  • start

  • stop

  • dt

  • rng

property current_source_id: int

The ID of the current source.

get_sdram_usage_in_bytes() int[source]
Returns:

The SDRAM usage in bytes of the current source.

property parameter_types: Mapping[str, DataType]

The parameter types for the current source.

property parameters: Mapping[str, int | float | Sequence[int] | Sequence[float]]

The parameters of the current source.

set_parameters(**parameters: int | float | Sequence[int] | Sequence[float]) None[source]

Set the current source parameters.

Parameters:

parameters – the parameters to set

class spynnaker.pyNN.models.current_sources.StepCurrentSource(times: Sequence[int] = (), amplitudes: Sequence[float] = ())

Bases: AbstractCurrentSource

Current source where the amplitude changes based on a time array.

Parameters:
  • times

  • amplitudes

property current_source_id: int

The ID of the current source.

get_sdram_usage_in_bytes() int[source]
Returns:

The SDRAM usage in bytes of the current source.

property parameter_types: Mapping[str, DataType]

The parameter types for the current source.

property parameters: Mapping[str, int | float | Sequence[int] | Sequence[float]]

The parameters of the current source.

set_parameters(**parameters: int | float | Sequence[int] | Sequence[float]) None[source]

Set the current source parameters.

Parameters:

parameters – the parameters to set