From c994238c9ebaba26501c957f6f38d6d75bb0143e Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 30 Oct 2024 13:16:44 +0000 Subject: [PATCH] flake8 --- spinnman/exceptions.py | 2 +- .../notification_protocol_start_resume.py | 2 +- .../spinnaker_boot/system_variable_boot_values.py | 2 +- spinnman/model/enums/executable_type.py | 8 ++++---- spinnman/spalloc/session.py | 6 ++++-- spinnman/transceiver/base_transceiver.py | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/spinnman/exceptions.py b/spinnman/exceptions.py index 018ad71f..29aebdca 100644 --- a/spinnman/exceptions.py +++ b/spinnman/exceptions.py @@ -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 diff --git a/spinnman/messages/eieio/command_messages/notification_protocol_start_resume.py b/spinnman/messages/eieio/command_messages/notification_protocol_start_resume.py index 2558337e..2898b47c 100644 --- a/spinnman/messages/eieio/command_messages/notification_protocol_start_resume.py +++ b/spinnman/messages/eieio/command_messages/notification_protocol_start_resume.py @@ -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() diff --git a/spinnman/messages/spinnaker_boot/system_variable_boot_values.py b/spinnman/messages/spinnaker_boot/system_variable_boot_values.py index 556cd0bf..01e1579d 100644 --- a/spinnman/messages/spinnaker_boot/system_variable_boot_values.py +++ b/spinnman/messages/spinnaker_boot/system_variable_boot_values.py @@ -29,7 +29,7 @@ class _DataType(Enum): LONG = (8, " "_DataType" : + def __new__(cls, value: int, struct_code: str) -> "_DataType": obj = object.__new__(cls) obj._value_ = value return obj diff --git a/spinnman/model/enums/executable_type.py b/spinnman/model/enums/executable_type.py index 823f8808..ba95c47d 100644 --- a/spinnman/model/enums/executable_type.py +++ b/spinnman/model/enums/executable_type.py @@ -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 @@ -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 diff --git a/spinnman/spalloc/session.py b/spinnman/spalloc/session.py index 86ea00f9..25312831 100644 --- a/spinnman/spalloc/session.py +++ b/spinnman/spalloc/session.py @@ -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. @@ -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: diff --git a/spinnman/transceiver/base_transceiver.py b/spinnman/transceiver/base_transceiver.py index c0b67f00..c57f56f7 100644 --- a/spinnman/transceiver/base_transceiver.py +++ b/spinnman/transceiver/base_transceiver.py @@ -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")