Fixing problem in test_connect_multiports
The first element of a.z0 was 0.
It is an error for the reference impedance to be zero.
@@ -84,7 +84,6 @@ class NetworkTestCase(unittest.TestCase):
self.assertEqual(self.ntwk1, ntwk1Saved)
os.remove(os.path.join(self.test_dir, 'ntwk1Saved.s2p'))
-
def test_pickling(self):
if six.PY2:
original_ntwk = self.ntwk1
@@ -121,7 +120,7 @@ class NetworkTestCase(unittest.TestCase):
a = rf.Network()
a.frequency=(1,)
a.s = npy.arange(16).reshape(4,4)
- a.z0 = range(4)
+ a.z0 = npy.arange(4) + 1 # Z0 should never be zero
b = rf.Network()
b.frequency=(1,)
@@ -129,12 +128,10 @@ class NetworkTestCase(unittest.TestCase):
b.z0 = npy.arange(4)+10
c=rf.connect(a,2,b,0,2)
- self.assertTrue((c.z0==[0,1,12,13]).all())
+ self.assertTrue((c.z0==[1,2,12,13]).all())
d=rf.connect(a,0,b,0,3)
- self.assertTrue((d.z0==[3,13]).all())
-
-
+ self.assertTrue((d.z0==[4,13]).all())
def test_connect_fast(self):
raise SkipTest('not supporting this function currently ')
