Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 30, 2024
1 parent 9d9b195 commit c994238
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spinnman/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import traceback
from types import TracebackType
from typing import (
Any, Generic, List, Optional, FrozenSet, TYPE_CHECKING, TypeVar, Union)
Generic, List, Optional, FrozenSet, TYPE_CHECKING, TypeVar, Union)
if TYPE_CHECKING:
from spinnman.messages.scp.enums import SCPResult
from spinnman.model.enums import CPUState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ def __init__(self) -> None:
@staticmethod
@overrides(EIEIOCommandMessage.from_bytestring)
def from_bytestring(command_header: EIEIOCommandHeader, data: bytes,
offset: int) -> "NotificationProtocolStartResume":
offset: int) -> "NotificationProtocolStartResume":
return NotificationProtocolStartResume()
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class _DataType(Enum):
LONG = (8, "<Q")
BYTE_ARRAY = (16, "s")

def __new__(cls, value: int, struct_code: str) -> "_DataType" :
def __new__(cls, value: int, struct_code: str) -> "_DataType":
obj = object.__new__(cls)
obj._value_ = value
return obj
Expand Down
8 changes: 4 additions & 4 deletions spinnman/model/enums/executable_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
from __future__ import annotations
from enum import Enum
from typing import FrozenSet, Sequence, Tuple
from typing import FrozenSet, Sequence
from spinnman.model.enums import CPUState


Expand Down Expand Up @@ -68,9 +68,9 @@ class ExecutableType(Enum):
"Runs immediately without waiting for barrier and never ends")

def __new__(cls, value: int, start_state: Sequence[CPUState],
end_state: Sequence[CPUState],
supports_auto_pause_and_resume: bool,
doc: str = "") -> 'ExecutableType':
end_state: Sequence[CPUState],
supports_auto_pause_and_resume: bool,
doc: str = "") -> 'ExecutableType':
obj = object.__new__(cls)
obj._value_ = value
obj. __doc__ = doc
Expand Down
6 changes: 4 additions & 2 deletions spinnman/spalloc/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ def _credentials(self) -> Tuple[Dict[str, str], Dict[str, str]]:

def websocket(
self, url: str, header: Optional[dict] = None,
cookie: Optional[str] = None, **kwargs: Any) -> websocket.WebSocket:
cookie: Optional[str] = None,
**kwargs: Any) -> websocket.WebSocket:
"""
Create a websocket that uses the session credentials to establish
itself.
Expand Down Expand Up @@ -374,7 +375,8 @@ def _service_url(self) -> str:
def _get(self, url: str, **kwargs: Any) -> requests.Response:
return self.__session.get(url, **kwargs)

def _post(self, url: str, json_dict: dict, **kwargs: Any) -> requests.Response:
def _post(self, url: str, json_dict: dict,
**kwargs: Any) -> requests.Response:
return self.__session.post(url, json_dict, **kwargs)

def _put(self, url: str, data: str, **kwargs: Any) -> requests.Response:
Expand Down
2 changes: 1 addition & 1 deletion spinnman/transceiver/base_transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ def __flood_execute_lock(self) -> Iterator[Condition]:
def execute_flood(
self, core_subsets: CoreSubsets,
executable: Union[BinaryIO, bytes, str], app_id: int, *,
n_bytes: Optional[int] = None, wait: bool = False) -> None :
n_bytes: Optional[int] = None, wait: bool = False) -> None:
if isinstance(executable, int):
# No executable is 4 bytes long
raise TypeError("executable may not be int")
Expand Down

0 comments on commit c994238

Please sign in to comment.