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

Function assert_array_approx_equal

numpy/ma/testutils.py:241–252  ·  view source on GitHub ↗

Checks the equality of two masked arrays, up to given number odecimals. The equality is checked elementwise.

(x, y, decimal=6, err_msg='', verbose=True)

Source from the content-addressed store, hash-verified

239
240
241def assert_array_approx_equal(x, y, decimal=6, err_msg='', verbose=True):
242 """
243 Checks the equality of two masked arrays, up to given number odecimals.
244
245 The equality is checked elementwise.
246
247 """
248 def compare(x, y):
249 "Returns the result of the loose comparison between x and y)."
250 return approx(x, y, rtol=10. ** -decimal)
251 assert_array_compare(compare, x, y, err_msg=err_msg, verbose=verbose,
252 header='Arrays are not almost equal')
253
254
255def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True):

Callers

nothing calls this directly

Calls 1

assert_array_compareFunction · 0.70

Tested by

no test coverage detected