Skip to content

Commit

Permalink
fix picklist
Browse files Browse the repository at this point in the history
  • Loading branch information
Shom770 committed Mar 3, 2024
1 parent 85494e0 commit d92e5e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/page_managers/picklist_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self):

# Requested stats is used to define the stats wanted in the picklist generation.
self.requested_stats = {
"Average Points Contributed": self.calculated_stats.average_points_contributed,
"Average Auto Cycles": partial(
self.calculated_stats.average_cycles,
mode=Queries.AUTO
Expand Down
3 changes: 3 additions & 0 deletions src/utils/calculated_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self, data: DataFrame):
self.data = data

# Point contribution methods
@_convert_to_float_from_numpy_type
def average_points_contributed(self, team_number: int) -> float:
"""Returns the average points contributed by a team.
Expand Down Expand Up @@ -83,6 +84,7 @@ def points_contributed_by_match(self, team_number: int, mode: str = "") -> Serie
)

# Cycle calculation methods
@_convert_to_float_from_numpy_type
def average_cycles(self, team_number: int, mode: str = None) -> float:
"""Calculates the average cycles for a team in either autonomous or teleop (wrapper around `cycles_by_match`).
Expand All @@ -98,6 +100,7 @@ def average_cycles(self, team_number: int, mode: str = None) -> float:
else:
return (self.cycles_by_match(team_number, Queries.AUTO) + self.cycles_by_match(team_number, Queries.TELEOP)).mean()

@_convert_to_float_from_numpy_type
def average_cycles_for_structure(self, team_number: int, structure: str) -> float:
"""Calculates the average cycles for a team for a structure (wrapper around `cycles_by_match`).
Expand Down

0 comments on commit d92e5e3

Please sign in to comment.