(N, dtype)
| 10004 | @pytest.mark.parametrize("N", np.arange(1, 512)) |
| 10005 | @pytest.mark.parametrize("dtype", [np.float32, np.float64]) |
| 10006 | def test_argsort_float(N, dtype): |
| 10007 | rnd = np.random.RandomState(116112) |
| 10008 | # (1) Regular data with a few nan: doesn't use vectorized sort |
| 10009 | arr = -0.5 + rnd.random(N).astype(dtype) |
| 10010 | arr[rnd.choice(arr.shape[0], 3)] = np.nan |
| 10011 | assert_arg_sorted(arr, np.argsort(arr, kind='quick')) |
| 10012 | |
| 10013 | # (2) Random data with inf at the end of array |
| 10014 | # See: https://github.com/intel/x86-simd-sort/pull/39 |
| 10015 | arr = -0.5 + rnd.rand(N).astype(dtype) |
| 10016 | arr[N-1] = np.inf |
| 10017 | assert_arg_sorted(arr, np.argsort(arr, kind='quick')) |
| 10018 | |
| 10019 | |
| 10020 | @pytest.mark.parametrize("N", np.arange(2, 512)) |
nothing calls this directly
no test coverage detected