Clean up types/imports

This commit is contained in:
Jan Petykiewicz 2026-02-15 12:40:47 -08:00
commit 8a56679884
5 changed files with 14 additions and 10 deletions

View file

@ -3,7 +3,7 @@ Tools are objects which dynamically generate simple single-use devices (e.g. wir
# TODO document all tools
"""
from typing import Literal, Any, Self, cast, TYPE_CHECKING
from typing import Literal, Any, Self, cast
from collections.abc import Sequence, Callable
from abc import ABCMeta # , abstractmethod # TODO any way to make Tool ok with implementing only one method?
from dataclasses import dataclass
@ -593,7 +593,7 @@ class AutoTool(Tool, metaclass=ABCMeta):
success = False
# If ccw is None, we don't need a bend, but we still loop to reuse the logic.
# We'll use a dummy loop if bends is empty and ccw is None.
bends = cast(list[AutoTool.Bend | None], self.bends)
bends = cast('list[AutoTool.Bend | None]', self.bends)
if ccw is None and not bends:
bends += [None]
@ -613,7 +613,7 @@ class AutoTool(Tool, metaclass=ABCMeta):
out_ptype_pair = (
'unk' if out_ptype is None else out_ptype,
straight.ptype if ccw is None else cast(AutoTool.Bend, bend).out_port.ptype
straight.ptype if ccw is None else cast('AutoTool.Bend', bend).out_port.ptype
)
out_transition = self.transitions.get(out_ptype_pair, None)
otrans_dxy = self._otransition2dxy(out_transition, bend_angle)