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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from __future__ import annotations
import logging
from typing import Any, cast, Optional, Sequence, Tuple, TYPE_CHECKING
from typing import Any, cast, Optional, Sequence, Tuple, Set, TYPE_CHECKING

import numpy

Expand Down Expand Up @@ -226,6 +226,13 @@ def is_split_core_capable(self) -> bool:
"""
raise NotImplementedError

def get_synapse_parameter_names(self) -> Set[str]:
"""
:return: the names of the parameters that can be extracted from
synapses read from the machine.
"""
return {"source", "target", "weight", "delay"}

def get_value(self, key: str) -> Any:
"""
Get a property.
Expand Down
6 changes: 3 additions & 3 deletions spynnaker/pyNN/models/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ def __get_data(
fixed_values: List[Tuple[str, int]] = list()
for attribute in attribute_names:
data_items.append(attribute)
if attribute not in {"source", "target", "weight", "delay"}:
value = self._synapse_information.synapse_dynamics.get_value(
attribute)
synapse_dynamics = self._synapse_information.synapse_dynamics
if attribute not in synapse_dynamics.get_synapse_parameter_names():
value = synapse_dynamics.get_value(attribute)
fixed_values.append((attribute, value))

# Return the connection data
Expand Down
Loading