MCPcopy
hub / github.com/numpy/numpy / assert_partitioned

Method assert_partitioned

numpy/_core/tests/test_multiarray.py:3588–3595  ·  view source on GitHub ↗
(self, d, kth)

Source from the content-addressed store, hash-verified

3586 assert_equal(dc, np.partition(d1, i, axis=1, kind=k))
3587
3588 def assert_partitioned(self, d, kth):
3589 prev = 0
3590 for k in np.sort(kth):
3591 assert_array_compare(operator.__le__, d[prev:k], d[k],
3592 err_msg=f'kth {k}')
3593 assert_((d[k:] >= d[k]).all(),
3594 msg=f"kth {k}, {d[k:]!r} not greater equal {d[k]!r}")
3595 prev = k + 1
3596
3597 def test_partition_iterative(self):
3598 d = np.arange(17)

Callers 3

test_partitionMethod · 0.95

Calls 4

assert_array_compareFunction · 0.90
assert_Function · 0.90
sortMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected