From de534a755ff6fdb8c50fb33071600dd66e4d0cd3 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Wed, 12 Nov 2025 23:34:23 -0800 Subject: [PATCH] fixup! [AutoTool] Use more dataclasses to clarify internal code --- masque/builder/tools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/masque/builder/tools.py b/masque/builder/tools.py index 9b0b3c8..d28b402 100644 --- a/masque/builder/tools.py +++ b/masque/builder/tools.py @@ -576,7 +576,7 @@ class AutoTool(Tool, metaclass=ABCMeta): def _itransition2dxy(in_transition: Transition | None) -> NDArray[numpy.float64]: if in_transition is None: return numpy.zeros(2) - irot = in_transition.our_port.rotation + irot = in_transition.their_port.rotation assert irot is not None itrans_dxy = rotation_matrix_2d(-irot) @ (in_transition.our_port.offset - in_transition.their_port.offset) return itrans_dxy @@ -617,8 +617,8 @@ class AutoTool(Tool, metaclass=ABCMeta): otrans_dxy = self._otransition2dxy(out_transition, bend_angle) b_transition = None - if ccw is not None and bend.out_port.ptype != straight.ptype: - b_transition = self.transitions.get((bend.out_port.ptype, straight.ptype), None) + if ccw is not None and bend.in_port.ptype != straight.ptype: + b_transition = self.transitions.get((bend.in_port.ptype, straight.ptype), None) btrans_dxy = self._itransition2dxy(b_transition) straight_length = length - bend_dxy[0] - itrans_dxy[0] - btrans_dxy[0] - otrans_dxy[0]