Skip to content

Commit 0563688

Browse files
authored
Merge pull request #1593 from SpiNNakerManchester/allow_extra_synapse_data
Allow extra synapse data
2 parents be432e5 + 039192d commit 0563688

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_synapse_dynamics.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import annotations
1616
import logging
17-
from typing import Any, cast, Optional, Sequence, Tuple, TYPE_CHECKING
17+
from typing import Any, cast, Optional, Sequence, Tuple, Set, TYPE_CHECKING
1818

1919
import numpy
2020

@@ -226,6 +226,13 @@ def is_split_core_capable(self) -> bool:
226226
"""
227227
raise NotImplementedError
228228

229+
def get_synapse_parameter_names(self) -> Set[str]:
230+
"""
231+
:return: the names of the parameters that can be extracted from
232+
synapses read from the machine.
233+
"""
234+
return {"source", "target", "weight", "delay"}
235+
229236
def get_value(self, key: str) -> Any:
230237
"""
231238
Get a property.

spynnaker/pyNN/models/projection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ def __get_data(
341341
fixed_values: List[Tuple[str, int]] = list()
342342
for attribute in attribute_names:
343343
data_items.append(attribute)
344-
if attribute not in {"source", "target", "weight", "delay"}:
345-
value = self._synapse_information.synapse_dynamics.get_value(
346-
attribute)
344+
synapse_dynamics = self._synapse_information.synapse_dynamics
345+
if attribute not in synapse_dynamics.get_synapse_parameter_names():
346+
value = synapse_dynamics.get_value(attribute)
347347
fixed_values.append((attribute, value))
348348

349349
# Return the connection data

0 commit comments

Comments
 (0)