diff --git a/app/games.py b/app/games.py index f70629f..26236e0 100644 --- a/app/games.py +++ b/app/games.py @@ -52,7 +52,9 @@ def parse_games(scoreboard_data): "Intermission": game["clock"]["inIntermission"] if game_state == "LIVE" else "N/A", - "Priority": calculate_game_priority(game) + get_comeback_bonus(game) + calculate_game_importance(game), + "Priority": calculate_game_priority(game) + + get_comeback_bonus(game) + + calculate_game_importance(game), "Start Time": get_start_time(game), "Home Record": format_record(game["homeTeam"]["record"]) if game["gameState"] in ["PRE", "FUT"] @@ -336,10 +338,12 @@ def calculate_game_importance(game): season_weight = 0.05 else: t = (avg_gp - 30) / (82 - 30) - season_weight = min(t ** 1.8, 1.0) + season_weight = min(t**1.8, 1.0) # Playoff relevance — peaks for bubble teams (wildcard rank ~17-19) - best_wc = min(home_st["wildcard_sequence"] or 32, away_st["wildcard_sequence"] or 32) + best_wc = min( + home_st["wildcard_sequence"] or 32, away_st["wildcard_sequence"] or 32 + ) if best_wc <= 12: playoff_relevance = 0.60 elif best_wc <= 16: diff --git a/tests/test_standings.py b/tests/test_standings.py index 8a174cc..3625d3b 100644 --- a/tests/test_standings.py +++ b/tests/test_standings.py @@ -293,7 +293,9 @@ class TestMigrateStandingsTable: migrate_standings_table(conn) - cols = [row[1] for row in conn.execute("PRAGMA table_info(standings)").fetchall()] + cols = [ + row[1] for row in conn.execute("PRAGMA table_info(standings)").fetchall() + ] assert "division_abbrev" in cols assert "conference_abbrev" in cols assert "games_played" in cols