handle pitstops without costs properly
This commit is contained in:
parent
158c419747
commit
cd9fc4755e
|
@ -38,7 +38,9 @@ class ConsumableStats:
|
||||||
for pitstop in pitstops:
|
for pitstop in pitstops:
|
||||||
self.overall_amount += pitstop.amount
|
self.overall_amount += pitstop.amount
|
||||||
self.amounts.append(StatsEvent(pitstop.date, pitstop.amount))
|
self.amounts.append(StatsEvent(pitstop.date, pitstop.amount))
|
||||||
self.price.append(StatsEvent(pitstop.date, pitstop.costs/pitstop.amount))
|
# some pitstops seem to have lost their costs...
|
||||||
|
if pitstop.costs:
|
||||||
|
self.price.append(StatsEvent(pitstop.date, pitstop.costs/pitstop.amount))
|
||||||
self.average_amount_fuelled = self.overall_amount / pitstop_count
|
self.average_amount_fuelled = self.overall_amount / pitstop_count
|
||||||
if pitstop_count > 1:
|
if pitstop_count > 1:
|
||||||
overall_distance = (
|
overall_distance = (
|
||||||
|
|
Loading…
Reference in New Issue