Skip to content

Commit

Permalink
Merge pull request #1066 from FranzForstmayr/numeric_issues
Browse files Browse the repository at this point in the history
Test allclose instead of equality
  • Loading branch information
FranzForstmayr committed May 7, 2024
2 parents 7fddac1 + 5dfb0d0 commit 984331b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion skrf/calibration/tests/test_calibration.py
Expand Up @@ -39,6 +39,11 @@
WG = rf.RectangularWaveguide(rf.F(75, 100, NPTS, unit='GHz'), a=100*rf.mil,
rho='gold', z0_override=50)

def _compare_dicts_allclose(first: dict, second: dict) -> None:
assert first.keys() == second.keys()
for k in first.keys():
npy.testing.assert_allclose(first[k], second[k], err_msg=f"Values from key '{k}' not equal!")


class DetermineTest(unittest.TestCase):
def setUp(self):
Expand Down Expand Up @@ -580,7 +585,7 @@ def test_coefs_8term(self):
self.assertEqual(self.cal.coefs_8term, self.cal.coefs)

def test_coefs_12term(self):
self.assertEqual(self.cal.coefs_12term, rf.convert_8term_2_12term(self.cal.coefs))
_compare_dicts_allclose(self.cal.coefs_12term, rf.convert_8term_2_12term(self.cal.coefs))

def test_input_not_modified(self):
dut_before = self.X.copy()
Expand Down

0 comments on commit 984331b

Please sign in to comment.