Skip to content

Commit 81f0ca1

Browse files
committed
simplify reset_graph_elements
1 parent a3edee7 commit 81f0ca1

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

spynnaker/pyNN/models/neuron/population_vertex.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
from pacman.model.resources import AbstractSDRAM, MultiRegionSDRAM
4343
from pacman.utilities.utility_calls import get_n_bits
4444

45-
from spinn_front_end_common.abstract_models import (
46-
AbstractCanReset)
4745
from spinn_front_end_common.interface.buffer_management\
4846
.recording_utilities import (
4947
get_recording_header_size, get_recording_data_constant_size)
@@ -173,7 +171,7 @@ def _is_structural(dynamics: AbstractSynapseDynamics
173171

174172
class PopulationVertex(
175173
PopulationApplicationVertex, AbstractAcceptsIncomingSynapses,
176-
AbstractCanReset, SupportsStructure):
174+
SupportsStructure):
177175
"""
178176
Underlying vertex model for Neural Populations.
179177
"""
@@ -1348,7 +1346,6 @@ def __str__(self) -> str:
13481346
def __repr__(self) -> str:
13491347
return self.__str__()
13501348

1351-
@overrides(AbstractCanReset.reset_to_first_timestep)
13521349
def reset_to_first_timestep(self) -> None:
13531350
# Reset state variables
13541351
self.__state_variables.copy_into(self.__initial_state_variables)

spynnaker/pyNN/spinnaker.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
from spynnaker.pyNN import model_binaries
4343
from spynnaker.pyNN.config_setup import add_spynnaker_cfg, SPYNNAKER_CFG
4444
from spynnaker.pyNN.models.recorder import Recorder
45-
from spynnaker.pyNN.models.neuron import AbstractPyNNNeuronModel
45+
from spynnaker.pyNN.models.neuron import (
46+
AbstractPyNNNeuronModel, PopulationVertex)
4647
from spynnaker.pyNN.data import SpynnakerDataView
4748
from spynnaker.pyNN.data.spynnaker_data_writer import SpynnakerDataWriter
4849
from spynnaker.pyNN.extra_algorithms import (
@@ -433,3 +434,9 @@ def _execute_buffer_extractor(self) -> None:
433434
if not get_config_bool("Machine", "virtual_board"):
434435
with NeoBufferDatabase() as db:
435436
db.write_t_stop()
437+
438+
@overrides(AbstractSpinnakerBase._execute_buffer_extractor)
439+
def _reset_graph_elements(self) -> None:
440+
for vertex in self._data_writer.get_vertices_by_type(
441+
PopulationVertex):
442+
vertex.reset_to_first_timestep()

0 commit comments

Comments
 (0)