(self)
| 3694 | assert_raises(ValueError, d.argpartition, 2, kind=k) |
| 3695 | |
| 3696 | def test_partition_fuzz(self): |
| 3697 | # a few rounds of random data testing |
| 3698 | for j in range(10, 30): |
| 3699 | for i in range(1, j - 2): |
| 3700 | d = np.arange(j) |
| 3701 | np.random.shuffle(d) |
| 3702 | d = d % np.random.randint(2, 30) |
| 3703 | idx = np.random.randint(d.size) |
| 3704 | kth = [0, idx, i, i + 1] |
| 3705 | tgt = np.sort(d)[kth] |
| 3706 | assert_array_equal(np.partition(d, kth)[kth], tgt, |
| 3707 | err_msg=f"data: {d!r}\n kth: {kth!r}") |
| 3708 | |
| 3709 | @pytest.mark.parametrize("kth_dtype", np.typecodes["AllInteger"]) |
| 3710 | def test_argpartition_gh5524(self, kth_dtype): |
nothing calls this directly
no test coverage detected