[PortList] add_port_pair requires unique port names
This commit is contained in:
parent
ffbe15c465
commit
d3be6aeba3
2 changed files with 44 additions and 0 deletions
|
|
@ -368,6 +368,8 @@ class PortList(metaclass=ABCMeta):
|
|||
Returns:
|
||||
self
|
||||
"""
|
||||
if names[0] == names[1]:
|
||||
raise PortError(f'Port names must be distinct: {names[0]!r}')
|
||||
new_ports = {
|
||||
names[0]: Port(offset, rotation=rotation, ptype=ptype),
|
||||
names[1]: Port(offset, rotation=rotation + pi, ptype=ptype),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue