@@ -58,7 +58,7 @@ def __init__(self) -> None:
5858 def complete (self , * rows : dict [str , _Any ], backward : bool = False ) -> dict [str , _Any ] | None :
5959 row = rows [0 ]
6060 if SpeedInferenceBase .skip (row ):
61- return
61+ return None
6262 speed = None
6363 if not speed_invalid (s := row ["front_wheel_speed" ]):
6464 speed = s
@@ -84,7 +84,7 @@ def complete(self, *rows: dict[str, _Any], backward: bool = False) -> dict[str,
8484 if (SpeedInferenceBase .skip (target ) or time_invalid (t_0 ) or
8585 time_invalid (t ) or speed_invalid (v_0 ) or
8686 acceleration_invalid (a_0 )):
87- return
87+ return None
8888 a = target ["forward_acceleration" ]
8989 if acceleration_invalid (a ):
9090 a = a_0
@@ -205,11 +205,11 @@ def complete(self, *rows: dict[str, _Any], backward: bool = False) -> dict[str,
205205 t_0 , t , v_0 , s_0 = base ["t" ], target ["t" ], base ["speed" ], base ["mileage" ]
206206 if (MileageInferenceBase .skip (target ) or time_invalid (t_0 ) or time_invalid (t ) or
207207 speed_invalid (v_0 ) or mileage_invalid (s_0 )):
208- return
208+ return None
209209 v = target ["speed" ]
210210 if speed_invalid (v ):
211211 v = v_0
212- return {"mileage" : s_0 + .00000125 * (v_0 + v ) * (t - t_0 ) / 9 }
212+ return {"mileage" : s_0 + 125e-8 * (v_0 + v ) * (t - t_0 ) / 9 }
213213
214214
215215class MileageInferenceByGPSPosition (MileageInferenceBase ):
@@ -249,7 +249,7 @@ def __init__(self, *channels: _Literal["front", "left", "right", "rear"]) -> Non
249249 @_override
250250 def complete (self , * rows : dict [str , _Any ], backward : bool = False ) -> dict [str , _Any ] | None :
251251 if backward :
252- return
252+ return None
253253 target , base = rows
254254 original_target = target .copy ()
255255 t_0 , t = target ["t" ], base ["t" ]
0 commit comments