Skip to content

Commit

Permalink
fix gear if gear is NaN (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
durandom authored Sep 5, 2023
1 parent a4432b2 commit af61153
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/paddock/telemetry/fast_lap_analyzer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import logging
import statistics

import numpy as np

from .analyzer import Analyzer
from .influx import Influx
from .models import FastLap
Expand Down Expand Up @@ -224,7 +226,7 @@ def gear_features(self, df):
# create a dict which maps the distance to the gear
distance_gear = dict(zip(distances, gears))
return {
"gear": int(gear),
"gear": int(gear) if not np.isnan(gear) else 0,
"distance_gear": distance_gear,
}

Expand Down

0 comments on commit af61153

Please sign in to comment.