(self, kth_dtype)
| 2772 | |
| 2773 | @pytest.mark.parametrize("kth_dtype", np.typecodes["AllInteger"]) |
| 2774 | def test_argpartition_empty_array(self, kth_dtype): |
| 2775 | # check axis handling for multidimensional empty arrays |
| 2776 | kth = np.array(0, dtype=kth_dtype)[()] |
| 2777 | a = np.array([]) |
| 2778 | a.shape = (3, 2, 1, 0) |
| 2779 | for axis in range(-a.ndim, a.ndim): |
| 2780 | msg = 'test empty array argpartition with axis={0}'.format(axis) |
| 2781 | assert_equal(np.partition(a, kth, axis=axis), |
| 2782 | np.zeros_like(a, dtype=np.intp), msg) |
| 2783 | msg = 'test empty array argpartition with axis=None' |
| 2784 | assert_equal(np.partition(a, kth, axis=None), |
| 2785 | np.zeros_like(a.ravel(), dtype=np.intp), msg) |
| 2786 | |
| 2787 | def test_partition(self): |
| 2788 | d = np.arange(10) |
nothing calls this directly
no test coverage detected