(self)
| 3100 | assert_raises(ValueError, d.argpartition, 2, kind=k) |
| 3101 | |
| 3102 | def test_partition_fuzz(self): |
| 3103 | # a few rounds of random data testing |
| 3104 | for j in range(10, 30): |
| 3105 | for i in range(1, j - 2): |
| 3106 | d = np.arange(j) |
| 3107 | np.random.shuffle(d) |
| 3108 | d = d % np.random.randint(2, 30) |
| 3109 | idx = np.random.randint(d.size) |
| 3110 | kth = [0, idx, i, i + 1] |
| 3111 | tgt = np.sort(d)[kth] |
| 3112 | assert_array_equal(np.partition(d, kth)[kth], tgt, |
| 3113 | err_msg="data: %r\n kth: %r" % (d, kth)) |
| 3114 | |
| 3115 | @pytest.mark.parametrize("kth_dtype", np.typecodes["AllInteger"]) |
| 3116 | def test_argpartition_gh5524(self, kth_dtype): |
nothing calls this directly
no test coverage detected