From a29009e76e97a4b77796d9c73698f29dc81d2bd1 Mon Sep 17 00:00:00 2001 From: jepson2k <55201008+Jepson2k@users.noreply.github.com> Date: Sun, 23 Aug 2026 11:39:31 -0400 Subject: [PATCH] Ignore ty's ParamSpec false positives on numba Dispatcher calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ty 0.0.74 compares every argument at a jitted call site against the full ParamSpec parameter tuple (astral-sh/ty#157 — ParamSpec support is partial), flooding 25 files with 580 false invalid-argument-type errors. The rule is config-ignored until ty handles ParamSpec calls; inline suppressions that became unused are dropped. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_0158QrPR5eVhd31AvFpxJKr6 --- parol6/server/controller.py | 6 +++--- parol6/server/motion_planner.py | 2 +- parol6/server/transports/serial_transport.py | 2 +- pyproject.toml | 8 ++++++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/parol6/server/controller.py b/parol6/server/controller.py index ab250d4..8361d96 100644 --- a/parol6/server/controller.py +++ b/parol6/server/controller.py @@ -650,11 +650,11 @@ def _process_command( # Dispatch by category (determined at registration time, no isinstance needed) match category: case CommandCategory.QUERY: - self._handle_query(command, state, addr) # type: ignore[arg-type, ty:invalid-argument-type] + self._handle_query(command, state, addr) # type: ignore[arg-type] case CommandCategory.SYSTEM: - self._handle_system_command(command, state, addr) # type: ignore[arg-type, ty:invalid-argument-type] + self._handle_system_command(command, state, addr) # type: ignore[arg-type] case CommandCategory.MOTION: - self._handle_motion_command(command, state, addr) # type: ignore[arg-type, ty:invalid-argument-type] + self._handle_motion_command(command, state, addr) # type: ignore[arg-type] def _handle_motion_command( self, command: MotionCommand, state: ControllerState, addr: tuple[str, int] diff --git a/parol6/server/motion_planner.py b/parol6/server/motion_planner.py index 9a3a7fe..25e687a 100644 --- a/parol6/server/motion_planner.py +++ b/parol6/server/motion_planner.py @@ -241,7 +241,7 @@ def process(self, params: object, command_index: int = 0) -> list[Segment]: cmd_class = self._registry.get_command_for_struct(type(params)) if cmd_class is not None and issubclass(cmd_class, self._trajectory_base): - self._handle_trajectory(command_index, params, cmd_class) # type: ignore[invalid-argument-type, ty:invalid-argument-type] + self._handle_trajectory(command_index, params, cmd_class) # type: ignore[invalid-argument-type] else: # Tool actions run concurrently with motion — don't flush blend if not isinstance(params, ToolActionCmd) and self._blend_buffer: diff --git a/parol6/server/transports/serial_transport.py b/parol6/server/transports/serial_transport.py index a26e822..07a1f60 100644 --- a/parol6/server/transports/serial_transport.py +++ b/parol6/server/transports/serial_transport.py @@ -158,7 +158,7 @@ def __init__( self._r_head = 0 self._r_tail = 0 self._frame_buf = np.zeros(64, dtype=np.uint8) - self._frame_mv = memoryview(self._frame_buf)[:52] # type: ignore[invalid-argument-type, ty:invalid-argument-type] + self._frame_mv = memoryview(self._frame_buf)[:52] # type: ignore[invalid-argument-type] self._frame_version = 0 self._frame_ts = 0.0 diff --git a/pyproject.toml b/pyproject.toml index 78015cc..2f10129 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,6 +101,14 @@ filterwarnings = [ ] [tool.ty] +# ty 0.0.74 mis-binds ParamSpec *args on numba's Dispatcher.__call__ stub: +# every argument at a jitted call site is compared against the full parameter +# tuple (astral-sh/ty#157 — ParamSpec support is still partial), flooding the +# repo with false invalid-argument-type errors. Ignored until ty handles +# ParamSpec calls; restore to error then. +[tool.ty.rules] +invalid-argument-type = "ignore" + # Dynamic Command union (built at import time from tagged structs) # generates invalid-type-form in all files that reference it. [[tool.ty.overrides]]