Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Nov 29, 2023
1 parent fee8d82 commit 4f16861
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_scp_data(self, scp_request: AbstractSCPRequest) -> bytes:
return _TWO_SKIP.pack() + scp_request.bytestring

@overrides(AbstractSCPConnection.receive_scp_response)
def receive_scp_response(self, timeout: Optional[float] =1.0) -> Tuple[
def receive_scp_response(self, timeout: Optional[float] = 1.0) -> Tuple[
SCPResult, int, bytes, int]:
data = self.receive(timeout)
result, sequence = _TWO_SHORTS.unpack_from(data, 10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,4 @@ def __repr__(self) -> str:

@overrides(Listenable.get_receive_method, return_narrowing=True)
def get_receive_method(self) -> Callable[[], bytes]:
return self.receive
return self.receive
5 changes: 3 additions & 2 deletions spinnman/processes/fixed_connection_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
from spinn_utilities.overrides import overrides
from .abstract_multi_connection_process_connection_selector import (
ConnectionSelector, ConnectionType)
from spinnman.connections.udp_packet_connections import (SCAMPConnection)
from spinnman.connections.udp_packet_connections import (
SCAMPConnection) # noqa: F401
from spinnman.messages.scp.abstract_messages import AbstractSCPRequest


class FixedConnectionSelector(
ConnectionSelector[ConnectionType], Generic[ConnectionType]):
ConnectionSelector[ConnectionType], Generic[ConnectionType]):
"""
A connection selector that only uses a single connection.
"""
Expand Down
5 changes: 3 additions & 2 deletions spinnman/processes/round_robin_connection_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Any, List
from typing import List
from spinn_utilities.overrides import overrides
from spinnman.connections.udp_packet_connections import SCAMPConnection
from spinnman.messages.scp.abstract_messages import AbstractSCPRequest
Expand All @@ -36,7 +36,8 @@ def __init__(self, connections: List[SCAMPConnection]):
self._next_connection_index = 0

@overrides(ConnectionSelector.get_next_connection, return_narrowing=True)
def get_next_connection(self, message: AbstractSCPRequest) -> SCAMPConnection:
def get_next_connection(
self, message: AbstractSCPRequest) -> SCAMPConnection:
index = self._next_connection_index
self._next_connection_index = (index + 1) % len(self._connections)
return self._connections[index]

0 comments on commit 4f16861

Please sign in to comment.