diff --git a/gfe_examples/sync_test/sync_test_vertex.py b/gfe_examples/sync_test/sync_test_vertex.py index 13bf8de5..67a7b949 100644 --- a/gfe_examples/sync_test/sync_test_vertex.py +++ b/gfe_examples/sync_test/sync_test_vertex.py @@ -14,22 +14,27 @@ from enum import IntEnum import logging + from spinn_utilities.log import FormatAdapter from spinn_utilities.overrides import overrides + from spinnman.model.enums import ExecutableType + +from pacman.model.graphs.application.abstract import ( + AbstractOneAppOneMachineVertex) from pacman.model.graphs.machine import MachineVertex from pacman.model.placements import Placement from pacman.model.resources import ConstantSDRAM + from spinn_front_end_common.data import FecDataView from spinn_front_end_common.interface.ds import DataSpecificationGenerator from spinn_front_end_common.utilities.constants import ( SYSTEM_BYTES_REQUIREMENT, BYTES_PER_WORD) from spinn_front_end_common.abstract_models import ( AbstractGeneratesDataSpecification, AbstractHasAssociatedBinary) + from spinnaker_graph_front_end.utilities.data_utils import ( - generate_system_data_region) -from pacman.model.graphs.application.abstract import ( - AbstractOneAppOneMachineVertex) + generate_system_data_region, SimulatorVertex) logger = FormatAdapter(logging.getLogger(__name__)) @@ -49,7 +54,7 @@ def __init__(self, lead, label=None): label, n_atoms=1) -class SyncTestMachineVertex(MachineVertex, AbstractHasAssociatedBinary, +class SyncTestMachineVertex(SimulatorVertex, AbstractGeneratesDataSpecification): def __init__(self, lead, app_vertex, label=None): super().__init__(label, app_vertex) @@ -82,8 +87,10 @@ def generate_data_specification( spec.write_value(0) else: routing_info = FecDataView.get_routing_infos() - spec.write_value(routing_info.get_first_key_from_pre_vertex( - self, SEND_PARTITION)) + key = routing_info.get_first_key_from_pre_vertex( + self, SEND_PARTITION) + assert(key is not None) + spec.write_value(key) # End-of-Spec: spec.end_specification() diff --git a/gfe_integration_tests/sdram_edge_tests/test_multi_dest_internal/sdram_splitter.py b/gfe_integration_tests/sdram_edge_tests/test_multi_dest_internal/sdram_splitter.py index a866a3d8..d0436832 100644 --- a/gfe_integration_tests/sdram_edge_tests/test_multi_dest_internal/sdram_splitter.py +++ b/gfe_integration_tests/sdram_edge_tests/test_multi_dest_internal/sdram_splitter.py @@ -31,7 +31,7 @@ class SDRAMSplitter(AbstractSplitterCommon): "_post_vertices", "_partition"] - def __init__(self): + def __init__(self) -> 'SDRAMSplitter': super().__init__() self.__pre_vertex = None self._post_vertices: list[SDRAMMachineVertex] = list() @@ -51,7 +51,7 @@ def get_out_going_vertices(self, partition_id: str) -> List[SDRAMMachineVertex]: return self._post_vertices @overrides(AbstractSplitterCommon.get_in_coming_vertices) - def get_in_coming_vertices(self, partition_id: str) -> SDRAMMachineVertex: + def get_in_coming_vertices(self, partition_id: str) -> List[SDRAMMachineVertex]: return [self._pre_vertex] def create_machine_vertices(self, chip_counter): @@ -102,7 +102,9 @@ def get_in_coming_slices(self) -> List[Slice]: @overrides(AbstractSplitterCommon.machine_vertices_for_recording) def machine_vertices_for_recording( self, variable_to_record: str) -> List[SDRAMMachineVertex]: - return [self._pre_vertex].extend(self._post_vertices) + mv = [self._pre_vertex] + mv.extend(self._post_vertices) + return mv @overrides(AbstractSplitterCommon.reset_called) def reset_called(self) -> None: diff --git a/gfe_integration_tests/sdram_edge_tests/test_multi_src_internal/sdram_splitter.py b/gfe_integration_tests/sdram_edge_tests/test_multi_src_internal/sdram_splitter.py index 85947749..8517dc73 100644 --- a/gfe_integration_tests/sdram_edge_tests/test_multi_src_internal/sdram_splitter.py +++ b/gfe_integration_tests/sdram_edge_tests/test_multi_src_internal/sdram_splitter.py @@ -28,13 +28,11 @@ class SDRAMSplitter(AbstractSplitterCommon): __slots__ = [ "_pre_vertices", - "__post_vertex", "_partition"] - def __init__(self): + def __init__(self) -> 'SDRAMSplitter': super().__init__() self._pre_vertices: List[SourceSegmentedSDRAMMachinePartition] = list() - self.__post_vertex = None @property def _post_vertex(self): @@ -43,14 +41,15 @@ def _post_vertex(self): @overrides(AbstractSplitterCommon.get_out_going_vertices) def get_out_going_vertices( - self, partition_id: str) -> SourceSegmentedSDRAMMachinePartition: - return [self._post_vertex] + self, partition_id: str) -> List[SourceSegmentedSDRAMMachinePartition]: + return [] @overrides(AbstractSplitterCommon.get_in_coming_vertices) def get_in_coming_vertices( self, partition_id: str) -> List[SourceSegmentedSDRAMMachinePartition]: return self._pre_vertices + def create_machine_vertices(self, chip_counter): # slices post_slice = Slice( @@ -97,7 +96,10 @@ def get_in_coming_slices(self) -> List[Slice]: @overrides(AbstractSplitterCommon.machine_vertices_for_recording) def machine_vertices_for_recording( self, variable_to_record: str) -> List[SourceSegmentedSDRAMMachinePartition]: - return [self._post_vertex].extend(self._pre_vertices) + mv = [self._post_vertex] + mv.extend(self._pre_vertices) + return mv + @overrides(AbstractSplitterCommon.reset_called) def reset_called(self) -> None: @@ -105,7 +107,7 @@ def reset_called(self) -> None: @overrides(AbstractSplitterCommon.get_internal_sdram_partitions) def get_internal_sdram_partitions( - self) -> SourceSegmentedSDRAMMachinePartition: + self) -> List[SourceSegmentedSDRAMMachinePartition]: assert isinstance( self._partition, SourceSegmentedSDRAMMachinePartition) return [self._partition] diff --git a/gfe_integration_tests/test_hello_world_untimed.py b/gfe_integration_tests/test_hello_world_untimed.py index 22f2be10..c588fb8d 100644 --- a/gfe_integration_tests/test_hello_world_untimed.py +++ b/gfe_integration_tests/test_hello_world_untimed.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from testfixtures import LogCapture +from testfixtures import LogCapture # type: ignore from spinnaker_testbase import ScriptChecker