From de9ad1626b8bea75e601287829297fecdaacc668 Mon Sep 17 00:00:00 2001 From: Robert Clark Date: Mon, 16 Dec 2019 16:27:30 -0600 Subject: [PATCH] Remove sorting of team's schedule The attempt to sort the remainder of a team's schedule in the Monte Carlo Simulation was causing errors given the sorting index is no longer valid. The remaining schedules no longer need to be sorted as they should already be in the correct order given how the data is presented. Regardless, the order likely doesn't matter. Signed-Off-By: Robert Clark --- common.py | 2 +- run-simulator.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common.py b/common.py index bc636ac9d..824f89b27 100644 --- a/common.py +++ b/common.py @@ -251,7 +251,7 @@ def determine_conference_standings(num_wins, conference_wins): def print_probabilities_ordered(probabilities): - sorted_ranks = [(v,k) for k,v in probabilities.iteritems()] + sorted_ranks = [(v,k) for k,v in probabilities.items()] sorted_ranks.sort(reverse=True) for probability, team in sorted_ranks: print('%s: %s%%' % (team, probability * 100.0)) diff --git a/run-simulator.py b/run-simulator.py index 5fecc6e12..a96a0d182 100644 --- a/run-simulator.py +++ b/run-simulator.py @@ -269,7 +269,6 @@ def get_remaining_schedule(conference_teams, teams, rankings): 'top_25': top_25 } remaining_schedule.append(populate_game_info(teams, game)) - remaining_schedule.sort() # Return a list of non-duplicate matches schedule = list(s for s, _ in itertools.groupby(remaining_schedule)) return schedule, current_records