From 33b44e6cc2f71f0f7ce893d03ea0ad0e76e6bccb Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Fri, 4 Aug 2023 16:35:11 +0100 Subject: [PATCH] fixes found by pylint --- spinnman/transceiver/base_transceiver.py | 26 ++++++++++---------- spinnman/transceiver/mockable_transceiver.py | 3 +++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/spinnman/transceiver/base_transceiver.py b/spinnman/transceiver/base_transceiver.py index 7086691a0..7a9bebac8 100644 --- a/spinnman/transceiver/base_transceiver.py +++ b/spinnman/transceiver/base_transceiver.py @@ -301,8 +301,8 @@ def _check_connection( @overrides(AbstractTransceiver.send_sdp_message) def send_sdp_message(self, message, connection=None): if connection is None: - self._scamp_connectio[random.randint( - 0, len(self._scamp_connectio) - 1)] + self._scamp_connection[random.randint( + 0, len(self._scamp_connection) - 1)] else: connection_to_use = connection connection_to_use.send_sdp_message(message) @@ -883,7 +883,7 @@ def read_word(self, x, y, base_address, cpu=0): (value, ) = _ONE_WORD.unpack(data) return value except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise @overrides(AbstractTransceiver.stop_application) @@ -909,7 +909,7 @@ def __log_where_is_info(self, cpu_infos): else: xys.add((cpu_info.x, cpu_info.y)) for (x, y) in xys: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) @overrides(AbstractTransceiver.wait_for_cores_to_be_in_state) def wait_for_cores_to_be_in_state( @@ -1109,7 +1109,7 @@ def malloc_sdram(self, x, y, size, app_id, tag=None): process.malloc_sdram(x, y, size, app_id, tag) return process.base_address except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise @overrides(AbstractTransceiver.load_multicast_routes) @@ -1119,7 +1119,7 @@ def load_multicast_routes(self, x, y, routes, app_id): self._scamp_connection_selector) process.load_routes(x, y, routes, app_id) except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise @overrides(AbstractTransceiver.load_fixed_route) @@ -1129,7 +1129,7 @@ def load_fixed_route(self, x, y, fixed_route, app_id): self._scamp_connection_selector) process.load_fixed_route(x, y, fixed_route, app_id) except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise @overrides(AbstractTransceiver.read_fixed_route) @@ -1139,7 +1139,7 @@ def read_fixed_route(self, x, y, app_id): self._scamp_connection_selector) return process.read_fixed_route(x, y, app_id) except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise @overrides(AbstractTransceiver.get_multicast_routes) @@ -1151,7 +1151,7 @@ def get_multicast_routes(self, x, y, app_id=None): self._scamp_connection_selector, app_id) return process.get_routes(x, y, base_address) except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise @overrides(AbstractTransceiver.clear_multicast_routes) @@ -1160,7 +1160,7 @@ def clear_multicast_routes(self, x, y): process = SendSingleCommandProcess(self._scamp_connection_selector) process.execute(RouterClear(x, y)) except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise @overrides(AbstractTransceiver.get_router_diagnostics) @@ -1170,7 +1170,7 @@ def get_router_diagnostics(self, x, y): self._scamp_connection_selector) return process.get_router_diagnostics(x, y) except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise @overrides(AbstractTransceiver.set_router_diagnostic_filter) @@ -1179,7 +1179,7 @@ def set_router_diagnostic_filter(self, x, y, position, diagnostic_filter): self.__set_router_diagnostic_filter( x, y, position, diagnostic_filter) except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise def __set_router_diagnostic_filter( @@ -1227,7 +1227,7 @@ def clear_router_diagnostic_counters(self, x, y): process.execute(WriteMemory( x, y, 0xf100002c, _ONE_WORD.pack(0xFFFFFFFF))) except Exception: - logger.info(self._where_is_xy(x, y)) + logger.info(self.where_is_xy(x, y)) raise def close(self): diff --git a/spinnman/transceiver/mockable_transceiver.py b/spinnman/transceiver/mockable_transceiver.py index f165c75d1..1dc4e3543 100644 --- a/spinnman/transceiver/mockable_transceiver.py +++ b/spinnman/transceiver/mockable_transceiver.py @@ -226,14 +226,17 @@ def update_provenance_and_exit(self, x, y, p): def where_is_xy(self, x, y): return f"Mocked {x=} {y=}" + @property @overrides(ExtendableTransceiver.bmp_connection) def bmp_connection(self): raise NotImplementedError("Needs to be mocked") + @property @overrides(ExtendableTransceiver.bmp_selector) def bmp_selector(self): raise NotImplementedError("Needs to be mocked") + @property @overrides(ExtendableTransceiver.scamp_connection_selector) def scamp_connection_selector(self): raise NotImplementedError("Needs to be mocked")