Skip to content

Commit

Permalink
merge fix found by flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 18, 2023
1 parent 55688bb commit 8305d89
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions spinnman/spalloc/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
from logging import getLogger
import re
import requests
from typing import Dict, Tuple, cast, Optional, Union
from typing import Dict, Tuple, cast, Optional
import websocket # type: ignore
from spinn_utilities.log import FormatAdapter
from spinn_utilities.typing.json import JsonArray, JsonObject
from spinn_utilities.typing.json import JsonObject
from .utils import clean_url
from spinnman.exceptions import SpallocException

Expand All @@ -36,7 +36,7 @@ def pp_req(request: requests.PreparedRequest):
"""
print('{} {}\n{}\r\n{}\r\n\r\n{}'.format(
'>>>>>>>>>>>START>>>>>>>>>>>',
request.method + ' ' + request.url,
request.method, request.url,
'\r\n'.join('{}: {}'.format(*kv)
for kv in request.headers.items()),
request.body if request.body else ""))
Expand Down Expand Up @@ -144,7 +144,7 @@ def get(self, url: str, timeout: int = 10, **kwargs) -> requests.Response:
return self.__handle_error_or_return(r)

@_may_renew
def post(self, url: str, jsonobj: dict, timeout: int = 10,
def post(self, url: str, json_dict: dict, timeout: int = 10,
**kwargs) -> requests.Response:
"""
Do an HTTP ``POST`` in the session.
Expand Down
4 changes: 2 additions & 2 deletions spinnman/spalloc/spalloc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import threading
from typing import (
ContextManager,
Callable, Collection, Dict, FrozenSet, Iterable, Iterator, List, Mapping,
Callable, Dict, FrozenSet, Iterable, Iterator, List, Mapping,
Optional, Tuple, cast)
from typing_extensions import TypeAlias
from websocket import WebSocket # type: ignore
Expand Down Expand Up @@ -736,7 +736,7 @@ def __init__(self, ws: WebSocket, receiver: _ProxyReceiver):
def _open_connection(self) -> int:
raise NotImplementedError

def _call(self, proto: ProxyProtocol, packer: struct.Struct,
def _call(self, protocol: ProxyProtocol, packer: struct.Struct,
unpacker: struct.Struct, *args) -> List[int]:
"""
Do a synchronous call.
Expand Down
4 changes: 2 additions & 2 deletions spinnman/transceiver/base_transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ def bmp_connection(self) -> BMPConnection:

@overrides(ExtendableTransceiver.where_is_xy)
def where_is_xy(self, x: int, y: int):
try:
try:
if SpiNNManDataView.has_machine():
return SpiNNManDataView.get_machine().where_is_xy(x, y)
return (f"No Machine. "
f"Root IP:{self._scamp_connections[0].remote_ip_address}"
f"x:{x} y:{y}")
except Exception as ex: # pylint: disable=broad-except
except Exception as ex: # pylint: disable=broad-except
return str(ex)

def __identify_connections(
Expand Down
2 changes: 1 addition & 1 deletion spinnman/transceiver/mockable_transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def send_chip_update_provenance_and_exit(self, x: int, y: int, p: int):
pass

@overrides(Transceiver.where_is_xy)
def where_is_xy(self, x:int, y:int):
def where_is_xy(self, x: int, y: int):
return f"Mocked {x=} {y=}"

@property
Expand Down
2 changes: 1 addition & 1 deletion spinnman/transceiver/transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ def send_chip_update_provenance_and_exit(self, x: int, y: int, p: int):
raise NotImplementedError("abstractmethod")

@abstractmethod
def where_is_xy(self, x:int, y:int):
def where_is_xy(self, x: int, y: int):
"""
Attempts to get where_is_x_y info from the machine
Expand Down

0 comments on commit 8305d89

Please sign in to comment.