From 244d3b8832f0c47681bb5625dd19e1087fd2f84e Mon Sep 17 00:00:00 2001 From: "Matthew N. White" Date: Tue, 10 Dec 2024 11:24:35 -0500 Subject: [PATCH] Actually test my tests --- HARK/tests/test_interpolation.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/HARK/tests/test_interpolation.py b/HARK/tests/test_interpolation.py index 2f81c1113..66df00b41 100644 --- a/HARK/tests/test_interpolation.py +++ b/HARK/tests/test_interpolation.py @@ -221,25 +221,25 @@ def setUp(self): self.one = np.ones(100) def test_eval(self): - self.assertEqual(self.X, self.IF1D(self.X)) - self.assertEqual(self.X, self.IF2Da(self.X, self.Y)) - self.assertEqual(self.Y, self.IF2Db(self.X, self.Y)) - self.assertEqual(self.X, self.IF3Da(self.X, self.Y, self.Z)) - self.assertEqual(self.Z, self.IF3Db(self.X, self.Y, self.Z)) + assert np.all(self.X == self.IF1D(self.X)) + assert np.all(self.X == self.IF2Da(self.X, self.Y)) + assert np.all(self.Y == self.IF2Db(self.X, self.Y)) + assert np.all(self.X == self.IF3Da(self.X, self.Y, self.Z)) + assert np.all(self.Z == self.IF3Db(self.X, self.Y, self.Z)) def test_der(self): - self.assertEqual(self.one, self.IF1D.der(self.X)) + assert np.all(self.one == self.IF1D.derivative(self.X)) - self.assertEqual(self.one, self.IF2Da.derX(self.X, self.Y)) - self.assertEqual(self.zero, self.IF2Da.derY(self.X, self.Y)) + assert np.all(self.one == self.IF2Da.derivativeX(self.X, self.Y)) + assert np.all(self.zero == self.IF2Da.derivativeY(self.X, self.Y)) - self.assertEqual(self.zero, self.IF2Db.derX(self.X, self.Y)) - self.assertEqual(self.one, self.IF2Db.derY(self.X, self.Y)) + assert np.all(self.zero == self.IF2Db.derivativeX(self.X, self.Y)) + assert np.all(self.one == self.IF2Db.derivativeY(self.X, self.Y)) - self.assertEqual(self.one, self.IF3Da.derX(self.X, self.Y, self.Z)) - self.assertEqual(self.zero, self.IF3Da.derY(self.X, self.Y, self.Z)) - self.assertEqual(self.zero, self.IF3Da.derZ(self.X, self.Y, self.Z)) + assert np.all(self.one == self.IF3Da.derivativeX(self.X, self.Y, self.Z)) + assert np.all(self.zero == self.IF3Da.derivativeY(self.X, self.Y, self.Z)) + assert np.all(self.zero == self.IF3Da.derivativeZ(self.X, self.Y, self.Z)) - self.assertEqual(self.zero, self.IF3Db.derX(self.X, self.Y, self.Z)) - self.assertEqual(self.zero, self.IF3Db.derY(self.X, self.Y, self.Z)) - self.assertEqual(self.one, self.IF3Db.derZ(self.X, self.Y, self.Z)) + assert np.all(self.zero == self.IF3Db.derivativeX(self.X, self.Y, self.Z)) + assert np.all(self.zero == self.IF3Db.derivativeY(self.X, self.Y, self.Z)) + assert np.all(self.one == self.IF3Db.derivativeZ(self.X, self.Y, self.Z))