summaryrefslogtreecommitdiff
path: root/f1elo/interface.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2014-11-14 19:34:30 +0100
committeremkael <emkael@tlen.pl>2014-11-14 19:34:30 +0100
commitdae5277ff5b51aa7a49ea7fa30bfced25a0d1b61 (patch)
tree31fc6aefa3adec2fdb64886638d63a84d4f6b352 /f1elo/interface.py
parentd84cc8c5230189249ed59856df71ba39ded58759 (diff)
* not adding new rankings for not ranked entries - DNSs and mechanical DNFs skewed the averages
Diffstat (limited to 'f1elo/interface.py')
-rw-r--r--f1elo/interface.py11
1 files changed, 6 insertions, 5 deletions
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