mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-08-06 00:36:29 +08:00
ty: fix unused warnings
This commit is contained in:
@@ -174,7 +174,7 @@ class BinaryStruct:
|
||||
if not is_dataclass(cls):
|
||||
dataclass(init=False)(cls)
|
||||
fields = list(getattr(cls, '__annotations__', {}).items())
|
||||
cls.__binary_fields__ = fields # type: ignore[attr-defined]
|
||||
cls.__binary_fields__ = fields
|
||||
|
||||
@classmethod
|
||||
def _read(inner_cls, reader: BinaryReader):
|
||||
@@ -184,7 +184,7 @@ class BinaryStruct:
|
||||
setattr(obj, name, value)
|
||||
return obj
|
||||
|
||||
cls._read = _read # type: ignore[attr-defined]
|
||||
cls._read = _read
|
||||
|
||||
@classmethod
|
||||
def from_bytes(cls: type[T], data: bytes) -> T:
|
||||
|
||||
+3
-3
@@ -85,7 +85,7 @@ def _parse_and_chunk_segment(args: tuple) -> list[dict]:
|
||||
if not messages:
|
||||
return []
|
||||
|
||||
dt_ns, chunks, current, next_time = 1e9 / fps, [], {}, messages[0].logMonoTime + 1e9 / fps # type: ignore[var-annotated]
|
||||
dt_ns, chunks, current, next_time = 1e9 / fps, [], {}, messages[0].logMonoTime + 1e9 / fps
|
||||
for msg in messages:
|
||||
if msg.logMonoTime >= next_time:
|
||||
chunks.append(current)
|
||||
@@ -159,7 +159,7 @@ def iter_segment_frames(camera_paths, start_time, end_time, fps=20, use_qcam=Fal
|
||||
seg_frames = FrameReader(path, pix_fmt="nv12")
|
||||
|
||||
assert seg_frames is not None
|
||||
frame = seg_frames[local_idx] if use_qcam else seg_frames.get(local_idx) # type: ignore[index, union-attr]
|
||||
frame = seg_frames[local_idx] if use_qcam else seg_frames.get(local_idx)
|
||||
yield global_idx, frame
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ def clip(route: Route, output: str, start: int, end: int, headless: bool = True,
|
||||
if big:
|
||||
from openpilot.selfdrive.ui.onroad.augmented_road_view import AugmentedRoadView
|
||||
else:
|
||||
from openpilot.selfdrive.ui.mici.onroad.augmented_road_view import AugmentedRoadView # type: ignore[assignment]
|
||||
from openpilot.selfdrive.ui.mici.onroad.augmented_road_view import AugmentedRoadView
|
||||
from openpilot.selfdrive.ui.ui_state import ui_state
|
||||
from openpilot.system.ui.lib.application import gui_app, FontWeight
|
||||
timer.lap("import")
|
||||
|
||||
Reference in New Issue
Block a user