def assertNpAlmostEqual(
     self,
     np_arr1,
     np_arr2,
     msg="Numpy arrays not equal.",
     threshold=1e-5,
 ):
     self.assertTrue(
         are_np_arrays_equal(np_arr1, np_arr2, threshold=threshold), msg)
 def assertNpNotEqual(self, np_arr1, np_arr2, msg="Numpy arrays equal"):
     self.assertFalse(are_np_arrays_equal(np_arr1, np_arr2), msg)
 def assertNpEqual(self, np_arr1, np_arr2, msg="Numpy arrays not equal."):
     self.assertTrue(are_np_arrays_equal(np_arr1, np_arr2), msg)
Esempio n. 4
0
 def assertNpEqual(self, np_arr1, np_arr2):
     self.assertTrue(
         are_np_arrays_equal(np_arr1, np_arr2),
         "Numpy arrays not equal"
     )
 def test_equal(self):
     a = np.array([1, 5])
     b = np.array([1.0000000001, 5])
     self.assertTrue(tu.are_np_arrays_equal(a, b))
 def test_not_equal(self):
     a = np.array([1, 5])
     b = np.array([1.0000000001, 5])
     self.assertFalse(tu.are_np_arrays_equal(a, b, threshold=1e-20))