Skip to content

Commit

Permalink
Actually test my tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mnwhite committed Dec 10, 2024
1 parent 86ae34e commit 244d3b8
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions HARK/tests/test_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 244d3b8

Please sign in to comment.