diff --git a/leads/context.py b/leads/context.py index d04f921..80effba 100644 --- a/leads/context.py +++ b/leads/context.py @@ -3,8 +3,6 @@ from time import time as _time from typing import TypeVar as _TypeVar, Generic as _Generic -from numpy import diff as _diff, average as _average, array as _array - from leads.constant import ESCMode from leads.data import DataContainer @@ -83,7 +81,7 @@ def lap_times(self) -> list[int]: return [self._lap_time_seq[i] - self._lap_time_seq[i - 1] for i in range(1, len(self._lap_time_seq))] def speed_trend(self) -> float: - return float(_average(_diff(_array(self._speed_seq)))) if len(self._speed_seq) > 1 else 0 + return (self._speed_seq[-1] - self._speed_seq[0]) / len(self._speed_seq) if len(self._speed_seq) > 1 else 0 def brake_indicator(self, brake_indicator: bool | None = None) -> bool | None: if brake_indicator is None: