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

Function assert_equal_records

numpy/ma/testutils.py:93–105  ·  view source on GitHub ↗

Asserts that two records are equal. Pretty crude for now.

(a, b)

Source from the content-addressed store, hash-verified

91
92
93def assert_equal_records(a, b):
94 """
95 Asserts that two records are equal.
96
97 Pretty crude for now.
98
99 """
100 assert_equal(a.dtype, b.dtype)
101 for f in a.dtype.names:
102 (af, bf) = (operator.getitem(a, f), operator.getitem(b, f))
103 if not (af is masked) and not (bf is masked):
104 assert_equal(operator.getitem(a, f), operator.getitem(b, f))
105 return
106
107
108def assert_equal(actual, desired, err_msg=''):

Callers 15

test_byviewMethod · 0.90
test_getMethod · 0.90
test_hardmaskMethod · 0.90
test_picklingMethod · 0.90
test_exotic_formatsMethod · 0.90
test_view_by_itselfMethod · 0.90
test_fromarraysMethod · 0.90
test_fromrecordsMethod · 0.90
test_toflexMethod · 0.90

Calls 1

assert_equalFunction · 0.70

Tested by

no test coverage detected