diff --git a/masque/builder/pather.py b/masque/builder/pather.py index fb13260..76e45b7 100644 --- a/masque/builder/pather.py +++ b/masque/builder/pather.py @@ -535,7 +535,7 @@ class Pather(PortList): if isinstance(portspec, str): portspec = [portspec] pos_keys = {'p', 'x', 'y', 'pos', 'position'} - pb = {k: bounds[k] for k in bounds if k in pos_keys} + pb = {k: bounds[k] for k in bounds if k in pos_keys and bounds[k] is not None} if pb: if len(portspec) > 1: raise BuildError('Position bounds only allowed with a single port') diff --git a/masque/test/test_pather_api.py b/masque/test/test_pather_api.py index 799896b..54a06be 100644 --- a/masque/test/test_pather_api.py +++ b/masque/test/test_pather_api.py @@ -279,6 +279,16 @@ def test_pather_trace_into() -> None: assert p.pattern.ports['G'].rotation is not None assert numpy.isclose(p.pattern.ports['G'].rotation, pi) + # 5. Vertical straight connector + p.pattern.ports['I'] = Port((0, 0), rotation=pi / 2) + p.pattern.ports['J'] = Port((0, -10000), rotation=3 * pi / 2) + p.at('I').trace_into('J', plug_destination=False) + assert 'J' in p.pattern.ports + assert 'I' in p.pattern.ports + assert numpy.allclose(p.pattern.ports['I'].offset, (0, -10000)) + assert p.pattern.ports['I'].rotation is not None + assert numpy.isclose(p.pattern.ports['I'].rotation, pi / 2) + def test_pather_jog_failed_fallback_is_atomic() -> None: lib = Library()