From cdaaa4cb15dfd77879d71d0e54660d1a7a225ee8 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 10 Sep 2024 08:35:16 +0100 Subject: [PATCH 1/5] support file to run mypy with spiinaker dependencies --- mypy.bash | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 mypy.bash diff --git a/mypy.bash b/mypy.bash new file mode 100755 index 00000000..c8d73948 --- /dev/null +++ b/mypy.bash @@ -0,0 +1,25 @@ +#!/bin/bash + +# Copyright (c) 2024 The University of Manchester +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This bash assumes that other repositories are installed in paralled + +# requires the latest mypy +# pip install --upgrade mypy + +utils="../SpiNNUtils/spinn_utilities" +machine="../SpiNNMachine/spinn_machine" + +mypy $utils $machine spinnman From 6adba86bc05bf4040e3d90673f5aa5543ce3097e Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 10 Sep 2024 10:13:21 +0100 Subject: [PATCH 2/5] skip on ConnectionError --- spinnman_integration_tests/test_job.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spinnman_integration_tests/test_job.py b/spinnman_integration_tests/test_job.py index f626e1ce..85e624a7 100644 --- a/spinnman_integration_tests/test_job.py +++ b/spinnman_integration_tests/test_job.py @@ -13,7 +13,7 @@ # limitations under the License. import unittest - +from requests.exceptions import ConnectionError from spinn_utilities.config_holder import set_config from spinn_machine.version import FIVE @@ -30,7 +30,10 @@ def setUp(self): self.spalloc_machine = "SpiNNaker1M" def test_create_job(self): - client = SpallocClient(self.spalloc_url) + try: + client = SpallocClient(self.spalloc_url) + except ConnectionError as ex: + raise unittest.SkipTest(str(ex)) # job = client.create_job_rect_at_board( # WIDTH, HEIGHT, triad=(x, y, b), machine_name=SPALLOC_MACHINE, # max_dead_boards=1) From da692d00a721c13f8e0e10e2c54b17224cc74fff Mon Sep 17 00:00:00 2001 From: Andrew Rowley Date: Wed, 18 Sep 2024 08:10:10 +0100 Subject: [PATCH 3/5] Allow odd RTE values, as crashes can cause oddities! --- spinnman/model/cpu_info.py | 12 ++++++++++-- spinnman/model/enums/run_time_error.py | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/spinnman/model/cpu_info.py b/spinnman/model/cpu_info.py index bf8787b6..fb726f95 100644 --- a/spinnman/model/cpu_info.py +++ b/spinnman/model/cpu_info.py @@ -61,6 +61,7 @@ class CPUInfo(object): "__processor_state_register", "__registers", "__run_time_error", + "__run_time_error_value", "__software_error_count", "__filename_address", "__line_number", @@ -102,7 +103,11 @@ def __init__(self, x: int, y: int, p: int, cpu_data: _vcpu_t): self.__application_name = app_name.decode('ascii') self.__registers: Sequence[int] = _REGISTERS_PATTERN.unpack(registers) - self.__run_time_error = RunTimeError(run_time_error) + self.__run_time_error_value = run_time_error + try: + self.__run_time_error = RunTimeError(run_time_error) + except ValueError: + self.__run_time_error = RunTimeError.UNRECOGNISED self.__state = CPUState(state) self.__application_mailbox_command = MailboxCommand(app_mailbox_cmd) @@ -353,10 +358,13 @@ def get_status_string(self) -> str: :rtype: str """ if self.state == CPUState.RUN_TIME_EXCEPTION: + rte_string = f"{self.run_time_error.name}" + if self.run_time_error == RunTimeError.UNRECOGNISED: + rte_string += f" ({self.__run_time_error_value})" return ( f"{self.__x}:{self.__y}:{self.__p} " f"(ph: {self.__physical_cpu_id}) " - f"in state {self.__state.name}:{self.__run_time_error.name}\n" + f"in state {self.__state.name}:{rte_string}\n" f" r0={self.__registers[0]}, r1={self.__registers[1]}, " f"r2={self.__registers[2]}, r3={self.__registers[3]}\n" f" r4={self.__registers[4]}, r5={self.__registers[5]}, " diff --git a/spinnman/model/enums/run_time_error.py b/spinnman/model/enums/run_time_error.py index c60e13e4..646eac2e 100644 --- a/spinnman/model/enums/run_time_error.py +++ b/spinnman/model/enums/run_time_error.py @@ -61,3 +61,5 @@ class RunTimeError(Enum): API = 19 #: Sark software version conflict SARK_VERSRION_INCORRECT = 20 + #: Unhandled exception + UNRECOGNISED = 99999 From c817f8a1f2ab6718e7dda8d3f6ada44928d58e78 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 1 Oct 2024 16:16:29 +0100 Subject: [PATCH 4/5] info for release 7.3.1 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 43646856..07616aa0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,7 +47,7 @@ packages = find: zip_safe = True include_package_data = True install_requires = - SpiNNMachine == 1!7.2.2 + SpiNNMachine == 1!7.3.1 websocket-client [options.packages.find] From 1081b9c6c906f14e98a3bd82fd8b69c67c571773 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 1 Oct 2024 16:16:30 +0100 Subject: [PATCH 5/5] info for release 7.3.1 --- spinnman/_version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spinnman/_version.py b/spinnman/_version.py index fc8f2480..c9d137cb 100644 --- a/spinnman/_version.py +++ b/spinnman/_version.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1!7.2.2" +__version__ = "1!7.3.1" __version_month__ = "TBD" __version_year__ = "TBD" __version_day__ = "TBD" -__version_name__ = "TO DO" +__version_name__ = "To Do"