Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Nov 9, 2024
1 parent 99e7f6a commit 8aa2dd0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/software/thunderscope/common/proto_parameter_tree_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from thefuzz import fuzz
from proto.import_all_protos import *


def __create_int_parameter_writable(key, value, descriptor):
"""Converts an int field of a proto to a NumericParameterItem with
the min/max bounds set according to the provided ParameterRangeOptions
Expand All @@ -18,7 +19,10 @@ def __create_int_parameter_writable(key, value, descriptor):
options = descriptor.GetOptions()

try:
minimum, maximum = options.Extensions[bounds].min_double_value, options.Extensions[bounds].max_double_value
minimum, maximum = (
options.Extensions[bounds].min_double_value,
options.Extensions[bounds].max_double_value,
)
except KeyError:
raise KeyError("{} missing ParameterRangeOptions".format(key))

Expand Down Expand Up @@ -46,7 +50,10 @@ def __create_double_parameter_writable(key, value, descriptor):
options = descriptor.GetOptions()

try:
minimum, maximum = options.Extensions[bounds].min_double_value, options.Extensions[bounds].max_double_value
minimum, maximum = (
options.Extensions[bounds].min_double_value,
options.Extensions[bounds].max_double_value,
)
except KeyError:
raise KeyError("{} missing ParameterRangeOptions".format(key))

Expand Down
4 changes: 1 addition & 3 deletions src/software/thunderscope/gl/layers/gl_tactic_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def refresh_graphics(self) -> None:
self.cached_world = self.world_buffer.get(block=False)
play_info = self.play_info_buffer.get(block=False).GetOptions()

self.__update_tactic_name_graphics(
self.cached_world.friendly_team, play_info
)
self.__update_tactic_name_graphics(self.cached_world.friendly_team, play_info)

def __update_tactic_name_graphics(self, team: Team, play_info) -> None:
"""Update the GLGraphicsItems that display tactic data
Expand Down
4 changes: 3 additions & 1 deletion src/software/thunderscope/play/playinfo_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def __init__(self, buffer_size: int = 1) -> None:

def refresh(self) -> None:
"""Update the play info widget with new play information"""
playinfo = self.playinfo_buffer.get(block=False, return_cached=False).GetOptions()
playinfo = self.playinfo_buffer.get(
block=False, return_cached=False
).GetOptions()

# Updating QTableWidget could be expensive, so we only update if there is new data
if playinfo is None or playinfo == self.last_playinfo:
Expand Down

0 comments on commit 8aa2dd0

Please sign in to comment.