From 5f8f9d18a4a86140c696f26bba3f866877e2b92a Mon Sep 17 00:00:00 2001 From: ATATC Date: Thu, 12 Dec 2024 12:26:44 -0500 Subject: [PATCH] Bug fixed: unmatched types. (#456) --- leads/data_persistence/analyzer/processor.py | 2 +- leads_gui/performance_checker.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/leads/data_persistence/analyzer/processor.py b/leads/data_persistence/analyzer/processor.py index 12afc68..84526e9 100644 --- a/leads/data_persistence/analyzer/processor.py +++ b/leads/data_persistence/analyzer/processor.py @@ -189,7 +189,7 @@ def shared_pre(row: dict[str, _Any], i: int) -> tuple[int, float, float]: return (dt := t - self._lap_start_time), ( ds := mileage - self._lap_start_mileage), 3600000 * ds / dt if dt else 0 - def shared_post(duration: float, distance: float, avg_speed: float) -> None: + def shared_post(duration: int, distance: float, avg_speed: float) -> None: if self._max_lap_duration is None or duration > self._max_lap_duration: self._max_lap_duration = duration if self._max_lap_distance is None or distance > self._max_lap_distance: diff --git a/leads_gui/performance_checker.py b/leads_gui/performance_checker.py index d29321a..5d741bc 100644 --- a/leads_gui/performance_checker.py +++ b/leads_gui/performance_checker.py @@ -20,7 +20,7 @@ def frame_rate(self) -> float: return 1 / _average(self._delay_seq) def net_delay(self) -> float: - return _average(self._net_delay_seq) + return float(_average(self._net_delay_seq)) def record_frame(self, last_interval: float) -> None: # add .0000000001 to avoid zero division