Skip to content

Commit

Permalink
fixes found by pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Aug 4, 2023
1 parent 9b055cc commit 33b44e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
26 changes: 13 additions & 13 deletions spinnman/transceiver/base_transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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(
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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(
Expand Down Expand Up @@ -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):
Expand Down
3 changes: 3 additions & 0 deletions spinnman/transceiver/mockable_transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 33b44e6

Please sign in to comment.