From 1cfa906201ce88a876c4aba02e7f9d94293419c7 Mon Sep 17 00:00:00 2001 From: "Quantizr (Jimmy)" <9859727+Quantizr@users.noreply.github.com> Date: Thu, 28 Aug 2025 00:06:30 -0700 Subject: [PATCH] small fixes --- tools/jotpluggler/data.py | 2 +- tools/jotpluggler/pluggle.py | 3 ++- tools/jotpluggler/views.py | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/jotpluggler/data.py b/tools/jotpluggler/data.py index b4ceb9affe..0cbc62bf13 100644 --- a/tools/jotpluggler/data.py +++ b/tools/jotpluggler/data.py @@ -266,7 +266,7 @@ class DataManager: pbar.update(1) if segment_result: self._add_segment(segment_result, start_time, end_time) - except Exception as e: + except Exception: cloudlog.exception(f"Error loading route {route}:") finally: self._finalize_loading() diff --git a/tools/jotpluggler/pluggle.py b/tools/jotpluggler/pluggle.py index b370ea69bc..a44fa2ed3c 100755 --- a/tools/jotpluggler/pluggle.py +++ b/tools/jotpluggler/pluggle.py @@ -5,6 +5,7 @@ import pyautogui import subprocess import dearpygui.dearpygui as dpg import threading +import numpy as np from openpilot.common.basedir import BASEDIR from openpilot.tools.jotpluggler.data import DataManager from openpilot.tools.jotpluggler.views import DataTreeView @@ -48,7 +49,7 @@ def calculate_avg_char_width(font): def format_and_truncate(value, available_width: float, avg_char_width: float) -> str: - s = str(value) + s = f"{value:.5f}" if np.issubdtype(type(value), np.floating) else str(value) max_chars = int(available_width / avg_char_width) - 3 if len(s) > max_chars: return s[: max(0, max_chars)] + "..." diff --git a/tools/jotpluggler/views.py b/tools/jotpluggler/views.py index 87889417f6..fd9fd09007 100644 --- a/tools/jotpluggler/views.py +++ b/tools/jotpluggler/views.py @@ -75,8 +75,8 @@ class TimeSeriesPanel(ViewPanel): value = value_array[position] if value is not None: - if isinstance(value, float): - formatted_value = f"{value:.4f}" if abs(value) < 1000 else f"{value:.3e}" + if np.issubdtype(type(value), np.floating): + formatted_value = f"{value:.5f}" else: formatted_value = str(value) @@ -228,7 +228,7 @@ class DataTreeView: def update_frame(self): items_processed = 0 - while self.ui_render_queue and items_processed < self.MAX_ITEMS_PER_FRAME: # process up to MAX_ITEMS_PER_FRAME to maintain perforamnce + while self.ui_render_queue and items_processed < self.MAX_ITEMS_PER_FRAME: # process up to MAX_ITEMS_PER_FRAME to maintain performance node, parent_tag, search_term, is_leaf = self.ui_render_queue.popleft() if is_leaf: self._create_leaf_ui(node, parent_tag)