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

Method assert_partitioned

numpy/core/tests/test_multiarray.py:2995–3001  ·  view source on GitHub ↗
(self, d, kth)

Source from the content-addressed store, hash-verified

2993 assert_equal(dc, np.partition(d1, i, axis=1, kind=k))
2994
2995 def assert_partitioned(self, d, kth):
2996 prev = 0
2997 for k in np.sort(kth):
2998 assert_array_less(d[prev:k], d[k], err_msg='kth %d' % k)
2999 assert_((d[k:] >= d[k]).all(),
3000 msg="kth %d, %r not greater equal %d" % (k, d[k:], d[k]))
3001 prev = k + 1
3002
3003 def test_partition_iterative(self):
3004 d = np.arange(17)

Callers 2

Calls 4

assert_array_lessFunction · 0.90
assert_Function · 0.90
sortMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected