1919import logging
2020from typing import (
2121 Dict , Iterable , List , Optional , Set , Tuple , cast , TYPE_CHECKING )
22+ from typing_extensions import Never
23+
2224from spinn_utilities .config_holder import get_config_bool
2325from spinn_utilities .log import FormatAdapter
2426from spinn_utilities .ordered_set import OrderedSet
@@ -132,7 +134,7 @@ def __init__(self) -> None:
132134
133135 def _request_data (
134136 self , placement_x : int , placement_y : int , address : int ,
135- length : int ) -> bytes :
137+ length : int ) -> bytearray :
136138 """
137139 Uses the extra monitor cores for data extraction.
138140
@@ -176,7 +178,7 @@ def _request_data(
176178 return extra_mon_data
177179
178180 @staticmethod
179- def _verify_data (extra_mon_data : bytes , txrx_data : bytes ) -> None :
181+ def _verify_data (extra_mon_data : bytearray , txrx_data : bytearray ) -> None :
180182 sm = difflib .SequenceMatcher (a = extra_mon_data , b = txrx_data )
181183 failed_index = - 1
182184 for (tag , i1 , i2 , j1 , j2 ) in sm .get_opcodes ():
@@ -406,8 +408,9 @@ def __python_extract_no_monitors(
406408 for placement in progress .over (recording_placements ):
407409 self ._retreive_by_placement (placement )
408410
409- def get_data_by_placement (self , placement : Placement ,
410- recording_region_id : int ) -> Tuple [bytes , bool ]:
411+ def get_data_by_placement (
412+ self , placement : Placement ,
413+ recording_region_id : int ) -> Tuple [memoryview , bool ]:
411414 """
412415 Deprecated use get_recording or get_download
413416
@@ -432,7 +435,7 @@ def get_data_by_placement(self, placement: Placement,
432435 f"Unable to get data for vertex { placement .vertex } " )
433436
434437 def get_recording (self , placement : Placement ,
435- recording_region_id : int ) -> Tuple [bytes , bool ]:
438+ recording_region_id : int ) -> Tuple [memoryview , bool ]:
436439 """
437440 Get the data container for the data retrieved
438441 during the simulation from a specific region area of a core.
@@ -457,7 +460,7 @@ def get_recording(self, placement: Placement,
457460 placement , recording_region_id , lookup_error )
458461
459462 def get_download (self , placement : Placement ,
460- recording_region_id : int ) -> Tuple [bytes , bool ]:
463+ recording_region_id : int ) -> Tuple [memoryview , bool ]:
461464 """
462465 Get the data container for the data retrieved
463466 during the simulation from a specific region area of a core.
@@ -479,11 +482,11 @@ def get_download(self, placement: Placement,
479482 placement .x , placement .y , placement .p ,
480483 recording_region_id , - 1 )
481484 except LookupError as lookup_error :
482- return self ._raise_error (
485+ self ._raise_error (
483486 placement , recording_region_id , lookup_error )
484487
485488 def _raise_error (self , placement : Placement , recording_region_id : int ,
486- lookup_error : LookupError ) -> Tuple [ bytes , bool ] :
489+ lookup_error : LookupError ) -> Never :
487490 """
488491 Raises the correct exception-
489492 """
0 commit comments