Fix deembedding tests
+import pytest
import skrf as rf
import unittest
import os
@@ -345,6 +346,7 @@ class DeembeddingTestCase(unittest.TestCase):
s2xthru = rf.Network(os.path.join(self.test_dir, 's2xthru.s2p'))
# interpolate to dc
s2xthru_dc = s2xthru.extrapolate_to_dc(kind='linear')
+ with pytest.warns(RuntimeWarning, match="DC point detected"):
dm_nzc = rf.IEEEP370_SE_NZC_2xThru(dummy_2xthru = s2xthru_dc,
name = '2xthru')
residuals = dm_nzc.deembed(s2xthru_dc)
@@ -370,6 +372,7 @@ class DeembeddingTestCase(unittest.TestCase):
nonuniform_freq = rf.Frequency(s2xthru.f[0], s2xthru.f[-1],
npoints=len(s2xthru)-10, unit='Hz')
s2xthru_nu = s2xthru.interpolate(nonuniform_freq)
+ with pytest.warns(RuntimeWarning, match="Non-uniform frequency vector detected"):
dm_nzc_nu = rf.IEEEP370_SE_NZC_2xThru(dummy_2xthru = s2xthru_nu,
name = '2xthru')
residuals = dm_nzc_nu.deembed(s2xthru_nu)
@@ -418,6 +421,7 @@ class DeembeddingTestCase(unittest.TestCase):
fdf = rf.Network(os.path.join(self.test_dir, 'fdf.s2p'))
s2xthru_dc = s2xthru.extrapolate_to_dc(kind='linear')
fdf_dc = fdf.extrapolate_to_dc(kind='linear')
+ with pytest.warns(RuntimeWarning, match="DC point detected"):
dm_zc = rf.IEEEP370_SE_ZC_2xThru(dummy_2xthru = s2xthru_dc,
dummy_fix_dut_fix = fdf_dc,
bandwidth_limit = 10e9,
@@ -451,6 +455,7 @@ class DeembeddingTestCase(unittest.TestCase):
npoints=len(s2xthru)-10, unit='Hz')
s2xthru_nu = s2xthru.interpolate(nonuniform_freq)
fdf_nu = fdf.interpolate(nonuniform_freq)
+ with pytest.warns(RuntimeWarning, match="Non-uniform frequency vector detected"):
dm_zc_nu = rf.IEEEP370_SE_ZC_2xThru(dummy_2xthru = s2xthru_nu,
dummy_fix_dut_fix = fdf_nu,
bandwidth_limit = 10e9,
