From c3b281a4f01c3a09a46022733b1ecf55429b3b1d Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sat, 5 Oct 2024 15:50:35 -0700 Subject: [PATCH] fixup! add `ok_connections` arg to allow plugging mismatched ports without warnings --- masque/builder/builder.py | 2 +- masque/ports.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/masque/builder/builder.py b/masque/builder/builder.py index b8b00be..fed839a 100644 --- a/masque/builder/builder.py +++ b/masque/builder/builder.py @@ -2,7 +2,7 @@ Simplified Pattern assembly (`Builder`) """ from typing import Self -from collections.abc import Sequence, Mapping +from collections.abc import Iterable, Sequence, Mapping import copy import logging from functools import wraps diff --git a/masque/ports.py b/masque/ports.py index e85b2d9..1cc711a 100644 --- a/masque/ports.py +++ b/masque/ports.py @@ -515,7 +515,7 @@ class PortList(metaclass=ABCMeta): o_offsets[:, 1] *= -1 o_rotations *= -1 - ok_pairs = {tuple(sorted(pair)) for pair in ok_connections if pair[0] != pair[1])} + ok_pairs = {tuple(sorted(pair)) for pair in ok_connections if pair[0] != pair[1]} type_conflicts = numpy.array([(st != ot) and ('unk' not in (st, ot)) and (tuple(sorted((st, ot))) not in ok_pairs) for st, ot in zip(s_types, o_types, strict=True)]) if type_conflicts.any():