From dae5277ff5b51aa7a49ea7fa30bfced25a0d1b61 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 14 Nov 2014 19:34:30 +0100 Subject: * not adding new rankings for not ranked entries - DNSs and mechanical DNFs skewed the averages --- f1elo/interface.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'f1elo/interface.py') diff --git a/f1elo/interface.py b/f1elo/interface.py index a492bba..79311ba 100644 --- a/f1elo/interface.py +++ b/f1elo/interface.py @@ -68,11 +68,12 @@ class Interface: ranks = elo.rank_race(race) driver_ranks = {} for entry, rank in ranks.iteritems(): - correction = rank / len(entry.drivers) - for driver in entry.drivers: - if driver not in driver_ranks: - driver_ranks[driver] = 0 - driver_ranks[driver] += correction + if entry.result_group: + correction = rank / len(entry.drivers) + for driver in entry.drivers: + if driver not in driver_ranks: + driver_ranks[driver] = 0 + driver_ranks[driver] += correction for driver, rank in driver_ranks.iteritems(): ranking = Ranking() ranking.rank_date = race.date -- cgit v1.2.3