Bug fix in connect
Fixes bug when connecting a two-port network to another network with
more than 2 ports.
Enables simplification in delay function.
@@ -2776,9 +2776,6 @@ class Network(object):
media = Freespace(frequency=self.frequency,z0=self.z0[:,port])
l =media.line(d=d, unit=unit,**kw)
- if port == 0:
- return connect(l, 1, self, port)
- else:
return connect(self, port, l, 0)
def windowed(self, window=('kaiser', 6), normalize=True, center_to_dc=None):
@@ -3497,8 +3494,8 @@ def connect(ntwkA, k, ntwkB, l, num=1):
if ntwkB.nports == 2 and ntwkA.nports > 2 and num == 1:
from_ports = list(range(ntwkC.nports))
to_ports = list(range(ntwkC.nports))
- to_ports.pop(k-1);
- to_ports.append(k-1)
+ to_ports.pop(k);
+ to_ports.append(k)
ntwkC.renumber(from_ports=from_ports,
to_ports=to_ports)
