MCPcopy Create free account
hub / github.com/numpy/numpy / test_ip_allclose

Method test_ip_allclose

numpy/core/tests/test_numeric.py:2447–2465  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2445 assert_(not np.allclose(x, y), "%s and %s shouldn't be close" % (x, y))
2446
2447 def test_ip_allclose(self):
2448 # Parametric test factory.
2449 arr = np.array([100, 1000])
2450 aran = np.arange(125).reshape((5, 5, 5))
2451
2452 atol = self.atol
2453 rtol = self.rtol
2454
2455 data = [([1, 0], [1, 0]),
2456 ([atol], [0]),
2457 ([1], [1+rtol+atol]),
2458 (arr, arr + arr*rtol),
2459 (arr, arr + arr*rtol + atol*2),
2460 (aran, aran + aran*rtol),
2461 (np.inf, np.inf),
2462 (np.inf, [np.inf])]
2463
2464 for (x, y) in data:
2465 self.tst_allclose(x, y)
2466
2467 def test_ip_not_allclose(self):
2468 # Parametric test factory.

Callers

nothing calls this directly

Calls 2

tst_allcloseMethod · 0.95
reshapeMethod · 0.80

Tested by

no test coverage detected