style: apply ruff formatting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
10
app/games.py
10
app/games.py
@@ -52,7 +52,9 @@ def parse_games(scoreboard_data):
|
|||||||
"Intermission": game["clock"]["inIntermission"]
|
"Intermission": game["clock"]["inIntermission"]
|
||||||
if game_state == "LIVE"
|
if game_state == "LIVE"
|
||||||
else "N/A",
|
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),
|
"Start Time": get_start_time(game),
|
||||||
"Home Record": format_record(game["homeTeam"]["record"])
|
"Home Record": format_record(game["homeTeam"]["record"])
|
||||||
if game["gameState"] in ["PRE", "FUT"]
|
if game["gameState"] in ["PRE", "FUT"]
|
||||||
@@ -336,10 +338,12 @@ def calculate_game_importance(game):
|
|||||||
season_weight = 0.05
|
season_weight = 0.05
|
||||||
else:
|
else:
|
||||||
t = (avg_gp - 30) / (82 - 30)
|
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)
|
# 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:
|
if best_wc <= 12:
|
||||||
playoff_relevance = 0.60
|
playoff_relevance = 0.60
|
||||||
elif best_wc <= 16:
|
elif best_wc <= 16:
|
||||||
|
|||||||
@@ -293,7 +293,9 @@ class TestMigrateStandingsTable:
|
|||||||
|
|
||||||
migrate_standings_table(conn)
|
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 "division_abbrev" in cols
|
||||||
assert "conference_abbrev" in cols
|
assert "conference_abbrev" in cols
|
||||||
assert "games_played" in cols
|
assert "games_played" in cols
|
||||||
|
|||||||
Reference in New Issue
Block a user