Skip to content

Commit

Permalink
fix results.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
mahithapen committed Dec 3, 2023
1 parent 77ca3f8 commit fca1758
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 0 additions & 7 deletions src/processing/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,11 @@ def results(game_state: GameState) -> str:
results_str += f" Field Goals Attempted: {player_state.field_goals_attempted}\n"
results_str += f" Field Goals Made: {player_state.field_goals}\n"
results_str += f" Points Scored: {player_state.points}\n"
results_str += f" Field Goal Percentage: {player_state.field_goal_percentage:.2f}\n"
results_str += f" Passes Made: {sum(player_state.passes.values())}\n"

# Format team statistics
results_str += "\nTeam Stats:\n"
for team_id, team in [('Team 1', game_state.team1), ('Team 2', game_state.team2)]:
results_str += f"{team_id}:\n"
results_str += f" Shots Attempted: {team.shots_attempted}\n"
results_str += f" Shots Made: {team.shots_made}\n"
results_str += f" Points: {team.points}\n"
results_str += f" Field Goal Percentage: {team.field_goal_percentage:.2f}\n"

# Format ball statistics
results_str += "\nBall Stats:\n"
results_str += f"Ball Frames: {game_state.ball.frames}\n"
Expand Down
1 change: 1 addition & 0 deletions src/view/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def download_results(upload_name):

with open(result_string_path, "r") as file:
st.session_state.result_string = file.read()
print(st.session_state.result_string)
st.session_state.processed_video = processed_video_path

# clean up temporary directory
Expand Down

0 comments on commit fca1758

Please sign in to comment.