From 274a3a6f866cc5c0e737b59bb1599b841befbc5d Mon Sep 17 00:00:00 2001 From: discountchubbs Date: Tue, 4 Aug 2026 15:55:49 -0700 Subject: [PATCH] lint --- openpilot/sunnypilot/modeld_v2/compile_modeld.py | 9 ++++++--- openpilot/sunnypilot/modeld_v2/modeld.py | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/openpilot/sunnypilot/modeld_v2/compile_modeld.py b/openpilot/sunnypilot/modeld_v2/compile_modeld.py index a51b8af3e4..2d6c977a94 100755 --- a/openpilot/sunnypilot/modeld_v2/compile_modeld.py +++ b/openpilot/sunnypilot/modeld_v2/compile_modeld.py @@ -75,7 +75,8 @@ def get_policy_npy_shapes(input_shapes: dict, is_supercombo: bool = False) -> tu return shapes, sizes -def generate_queues_and_npy(input_shapes: dict, frame_skip: int, device: str = Device.DEFAULT, is_supercombo: bool = False, use_packed: bool = True) -> tuple[dict, dict]: +def generate_queues_and_npy(input_shapes: dict, frame_skip: int, device: str = Device.DEFAULT, + is_supercombo: bool = False, use_packed: bool = True) -> tuple[dict, dict]: road_key, _ = _detect_vision_keys(input_shapes) if not road_key: raise ValueError("Vision road key missing from input shapes.") @@ -146,11 +147,13 @@ def generate_queues_and_npy(input_shapes: dict, frame_skip: int, device: str = D return queues, npy_arrays -def make_split_input_queues(vision_input_shapes: dict, policy_input_shapes: dict, frame_skip: int, device: str = Device.DEFAULT, use_packed: bool = True) -> tuple[dict, dict]: +def make_split_input_queues(vision_input_shapes: dict, policy_input_shapes: dict, + frame_skip: int, device: str = Device.DEFAULT, use_packed: bool = True) -> tuple[dict, dict]: return generate_queues_and_npy({**vision_input_shapes, **policy_input_shapes}, frame_skip, device, is_supercombo=False, use_packed=use_packed) -def make_supercombo_input_queues(input_shapes: dict, frame_skip: int, device: str = Device.DEFAULT, use_packed: bool = True) -> tuple[dict, dict]: +def make_supercombo_input_queues(input_shapes: dict, frame_skip: int, + device: str = Device.DEFAULT, use_packed: bool = True) -> tuple[dict, dict]: return generate_queues_and_npy(input_shapes, frame_skip, device, is_supercombo=True, use_packed=use_packed) diff --git a/openpilot/sunnypilot/modeld_v2/modeld.py b/openpilot/sunnypilot/modeld_v2/modeld.py index 38ee9d821b..b53ab18c73 100755 --- a/openpilot/sunnypilot/modeld_v2/modeld.py +++ b/openpilot/sunnypilot/modeld_v2/modeld.py @@ -136,7 +136,8 @@ class ModelState(ModelStateBase): self._vision_input_names = [key for key in model_metadata['input_shapes'] if 'img' in key] from openpilot.sunnypilot.modeld_v2.compile_modeld import make_supercombo_input_queues frame_skip = derive_frame_skip({}, model_metadata['input_shapes']) - self.input_queues, self.numpy_inputs = make_supercombo_input_queues(model_metadata['input_shapes'], frame_skip, device=self.QUEUE_DEV, use_packed=use_packed) + self.input_queues, self.numpy_inputs = make_supercombo_input_queues(model_metadata['input_shapes'], + frame_skip, device=self.QUEUE_DEV, use_packed=use_packed) else: vision_metadata = metadata['vision'] policy_keys = [k for k in metadata if k != 'vision'] @@ -154,7 +155,8 @@ class ModelState(ModelStateBase): policy_input_shapes = first_policy_metadata['input_shapes'] self._vision_input_names = [k for k in vision_input_shapes if 'img' in k] frame_skip = derive_frame_skip(vision_input_shapes, policy_input_shapes) - self.input_queues, self.numpy_inputs = make_split_input_queues(vision_input_shapes, policy_input_shapes, frame_skip, device=self.QUEUE_DEV, use_packed=use_packed) + self.input_queues, self.numpy_inputs = make_split_input_queues(vision_input_shapes, policy_input_shapes, + frame_skip, device=self.QUEUE_DEV, use_packed=use_packed) self._desire_key = next(key for key in self.numpy_inputs if key.startswith('desire')) self._road_key = next(key for key in self._vision_input_names if 'big' not in key)