Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions spynnaker/pyNN/external_devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
accuracy to gain performance.
"""
import os
from typing import Optional, Tuple
from typing import Any, Dict, Optional, Tuple
from spinn_utilities.socket_address import SocketAddress
from spinnman.messages.eieio import EIEIOType
from spinn_front_end_common.abstract_models import (
Expand Down Expand Up @@ -206,7 +206,8 @@ def EthernetControlPopulation(
n_neurons: int, model: _CellTypeArg, label: Optional[str] = None,
local_host: Optional[str] = None, local_port: Optional[int] = None,
database_notify_port_num: Optional[int] = None,
database_ack_port_num: Optional[int] = None) -> Population:
database_ack_port_num: Optional[int] = None,
**additional_kwargs: Dict[str, Any]) -> Population:
# pylint: disable=invalid-name
"""
Create a PyNN population that can be included in a network to
Expand All @@ -226,6 +227,8 @@ def EthernetControlPopulation(
:param database_notify_port_num:
The optional port to which notifications from the database
notification protocol are to be sent
:param additional_kwargs:
A nicer way of allowing additional things to the Population
:return:
A pyNN Population which can be used as the target of a Projection.

Expand All @@ -235,7 +238,8 @@ def EthernetControlPopulation(
:raises TypeError: If an invalid model class is used.
"""
# pylint: disable=global-statement
population = Population(n_neurons, model, label=label)
population = Population(n_neurons, model, label=label,
**additional_kwargs)
vertex, aec, vertex_label = __vtx(population)
translator = aec.get_message_translator()
live_packet_gather_label = "EthernetControlReceiver"
Expand Down Expand Up @@ -273,7 +277,8 @@ def EthernetControlPopulation(
def EthernetSensorPopulation(
device: AbstractEthernetSensor, local_host: Optional[str] = None,
database_notify_port_num: Optional[int] = None,
database_ack_port_num: Optional[int] = None) -> Population:
database_ack_port_num: Optional[int] = None,
**additional_kwargs: Dict[str, Any]) -> Population:
# pylint: disable=invalid-name
"""
Create a pyNN population which can be included in a network to
Expand All @@ -289,6 +294,8 @@ def EthernetSensorPopulation(
:param database_notify_port_num:
The optional port to which notifications from the database
notification protocol are to be sent
:param additional_kwargs:
A nicer way of allowing additional things to the Population
:return:
A pyNN Population which can be used as the source of a Projection.

Expand All @@ -304,7 +311,8 @@ def EthernetSensorPopulation(
population = Population(
device.get_n_neurons(), SpikeInjector(notify=False),
label=device.get_injector_label(),
additional_parameters=injector_params)
additional_parameters=injector_params,
**additional_kwargs)
if isinstance(device, AbstractSendMeMulticastCommandsVertex):
cmd_conn = EthernetCommandConnection(
device.get_translator(), [device], local_host,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def live_neuron_voltage() -> None:
len(devices_1), model_1)
ext_pop.record(["v"])
ext_pop_2 = p.external_devices.EthernetControlPopulation(
len(devices_2), model_2)
len(devices_2), model_2, n_synapse_cores=1)
ext_pop_2.record(["v"])
p.Projection(
stim, ext_pop, p.OneToOneConnector(), p.StaticSynapse(1.0, 1.0))
Expand Down
Loading