From a1352869ad5cc18f061e3aabb7975ff8b61aa3dc Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Thu, 22 Feb 2024 23:04:49 -0500 Subject: [PATCH] fix: adjust game score calculation --- app/scoreboard/process_data.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/scoreboard/process_data.py b/app/scoreboard/process_data.py index a8c64c7..62e7702 100644 --- a/app/scoreboard/process_data.py +++ b/app/scoreboard/process_data.py @@ -108,11 +108,11 @@ def calculate_game_priority(game): away_total = away_team_standings["league_sequence"] + away_team_standings["league_l10_sequence"] # Calculate the matchup adjustment factor - matchup_multiplier = {5: 1, 4: 1, 3: 1.25, 2: 1.50, 1: 2}.get(period) + matchup_multiplier = {5: 1, 4: 1, 3: 1.50, 2: 1.65, 1: 2}.get(period) matchup_adjustment = (home_total + away_total) * matchup_multiplier # Calculate the base priority based on period - base_priority = {5: 650, 4: 600, 3: 300, 2: 200}.get(period, 100) + base_priority = {5: 650, 4: 600, 3: 300, 2: 200}.get(period, 150) # Adjust base priority based on score difference score_differential_adjustment = 0 @@ -130,8 +130,18 @@ def calculate_game_priority(game): base_priority -= score_differential_adjustment # Adjust base priority based on certain conditions - if score_difference == 0 and period == 3 and time_remaining <= 600: - base_priority += 100 + if period == 3 and time_remaining <= 720: + if score_difference == 0: + base_priority += 100 + elif score_difference == 1: + base_priority += 60 + + if period == 3 and time_remaining <= 360: + if score_difference == 0: + base_priority += 50 + elif score_difference == 1: + base_priority += 30 + # Calculate time priority time_multiplier = {4: 2, 3: 2, 2: 1.5}.get(period, 0.75)