Skip to content

Commit

Permalink
Bug fixed: visual data is not optional. (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
ATATC committed Oct 5, 2024
1 parent bef35cb commit a287416
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions leads/data_persistence/analyzer/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ def unit(row: dict[str, _Any], i: int) -> None:
# visual
latencies = [row[key] for key in ("front_view_latency", "left_view_latency", "right_view_latency",
"rear_view_latency") if key in row.keys()]
latency = min(latencies)
if not latency_invalid(latency) and (self._min_latency is None or latency < self._min_latency):
self._min_latency = latency
latency = max(latencies)
if not latency_invalid(latency) and (self._max_latency is None or latency > self._max_latency):
self._max_latency = latency
if len(latencies) > 1:
latency = min(latencies)
if not latency_invalid(latency) and (self._min_latency is None or latency < self._min_latency):
self._min_latency = latency
latency = max(latencies)
if not latency_invalid(latency) and (self._max_latency is None or latency > self._max_latency):
self._max_latency = latency

self.foreach(unit, False)
if self._valid_rows_count == 0:
Expand Down

0 comments on commit a287416

Please sign in to comment.