(self, dt, step)
| 2141 | np.dtype([('f', float), ('i', object)])]) |
| 2142 | @pytest.mark.parametrize("step", [1, 2]) |
| 2143 | def test_sort_structured(self, dt, step): |
| 2144 | # test record array sorts. |
| 2145 | a = np.array([(i, i) for i in range(101*step)], dtype=dt) |
| 2146 | b = a[::-1] |
| 2147 | for kind in ['q', 'h', 'm']: |
| 2148 | msg = "kind=%s" % kind |
| 2149 | c = a.copy()[::step] |
| 2150 | indx = c.argsort(kind=kind) |
| 2151 | c.sort(kind=kind) |
| 2152 | assert_equal(c, a[::step], msg) |
| 2153 | assert_equal(a[::step][indx], a[::step], msg) |
| 2154 | c = b.copy()[::step] |
| 2155 | indx = c.argsort(kind=kind) |
| 2156 | c.sort(kind=kind) |
| 2157 | assert_equal(c, a[step-1::step], msg) |
| 2158 | assert_equal(b[::step][indx], a[step-1::step], msg) |
| 2159 | |
| 2160 | @pytest.mark.parametrize('dtype', ['datetime64[D]', 'timedelta64[D]']) |
| 2161 | def test_sort_time(self, dtype): |
nothing calls this directly
no test coverage detected