MCPcopy Index your code
hub / github.com/numpy/numpy / test_combinations

Method test_combinations

numpy/_core/tests/test_multiarray.py:5530–5552  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

5528
5529 @pytest.mark.parametrize('data', nan_arr)
5530 def test_combinations(self, data):
5531 arr, pos = data
5532 with warnings.catch_warnings():
5533 warnings.filterwarnings(
5534 'ignore',
5535 "invalid value encountered in reduce",
5536 RuntimeWarning)
5537 val = np.max(arr)
5538
5539 assert_equal(np.argmax(arr), pos, err_msg=f"{arr!r}")
5540 assert_equal(arr[np.argmax(arr)], val, err_msg=f"{arr!r}")
5541
5542 # add padding to test SIMD loops
5543 rarr = np.repeat(arr, 129)
5544 rpos = pos * 129
5545 assert_equal(np.argmax(rarr), rpos, err_msg=f"{rarr!r}")
5546 assert_equal(rarr[np.argmax(rarr)], val, err_msg=f"{rarr!r}")
5547
5548 padd = np.repeat(np.min(arr), 513)
5549 rarr = np.concatenate((arr, padd))
5550 rpos = pos
5551 assert_equal(np.argmax(rarr), rpos, err_msg=f"{rarr!r}")
5552 assert_equal(rarr[np.argmax(rarr)], val, err_msg=f"{rarr!r}")
5553
5554 def test_maximum_signed_integers(self):
5555

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
maxMethod · 0.45
argmaxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected