Skip to content

Commit 9d6518c

Browse files
authored
Merge pull request #326 from SpiNNakerManchester/mypy2
Strict bytes
2 parents 8e6a1bb + 7561db1 commit 9d6518c

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/python_actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on: [push]
2020

2121
jobs:
2222
call:
23-
uses: SpiNNakerManchester/SupportScripts/.github/workflows/python_checks.yml@main
23+
uses: SpiNNakerManchester/SupportScripts/.github/workflows/python_checks.yml@mypy2
2424
with:
2525
dependencies: SpiNNUtils SpiNNMachine SpiNNMan PACMAN spalloc SpiNNFrontEndCommon TestBase
2626
ubuntu-packages: graphviz

gfe_examples/template/template_vertex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _write_app_memory_regions(self, spec: DataSpecificationGenerator,
120120
spec.write_value(int(key is not None))
121121
spec.write_value(0 if key is None else key)
122122

123-
def read(self) -> bytes:
123+
def read(self) -> memoryview:
124124
"""
125125
Get the recorded data.
126126

gfe_integration_tests/test_extra_monitor/test_extra_monitor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_data_region_address(placement: Placement, region: DataRegions) -> int:
4242
return transceiver.read_word(placement.x, placement.y, address_location)
4343

4444

45-
def check_data(data: bytes) -> None:
45+
def check_data(data: bytearray) -> None:
4646
# check data is correct here
4747
ints = n_word_struct(len(data) // 4).unpack(data)
4848
start_value = 0
@@ -57,7 +57,7 @@ def check_data(data: bytes) -> None:
5757

5858
def _do_transfer(gatherer: DataSpeedUpPacketGatherMachineVertex,
5959
receiver_placement: Placement, writer_placement: Placement,
60-
writer_vertex: SDRAMWriter) -> bytes:
60+
writer_vertex: SDRAMWriter) -> bytearray:
6161
with StreamingContextManager(FecDataView.iterate_gathers()):
6262
extra_monitor = receiver_placement.vertex
6363
assert isinstance(extra_monitor, ExtraMonitorSupportMachineVertex)

spinnaker_graph_front_end/utilities/simulator_vertex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def placement(self) -> Placement:
9797
return FecDataView.get_placement_of_vertex(self)
9898

9999
def get_recording_channel_data(
100-
self, recording_id: int) -> Tuple[bytes, bool]:
100+
self, recording_id: int) -> Tuple[memoryview, bool]:
101101
"""
102102
Get the data from a recording channel. The simulation must have
103103
:py:func:`spinnaker_graph_front_end.run` before this will work,

0 commit comments

Comments
 (0)