Test in1d's invert parameter
(self, kind)
| 329 | |
| 330 | @pytest.mark.parametrize("kind", [None, "sort", "table"]) |
| 331 | def test_in1d_invert(self, kind): |
| 332 | "Test in1d's invert parameter" |
| 333 | # We use two different sizes for the b array here to test the |
| 334 | # two different paths in in1d(). |
| 335 | for mult in (1, 10): |
| 336 | a = np.array([5, 4, 5, 3, 4, 4, 3, 4, 3, 5, 2, 1, 5, 5]) |
| 337 | b = [2, 3, 4] * mult |
| 338 | assert_array_equal(np.invert(in1d(a, b, kind=kind)), |
| 339 | in1d(a, b, invert=True, kind=kind)) |
| 340 | |
| 341 | # float: |
| 342 | if kind in {None, "sort"}: |
| 343 | for mult in (1, 10): |
| 344 | a = np.array([5, 4, 5, 3, 4, 4, 3, 4, 3, 5, 2, 1, 5, 5], |
| 345 | dtype=np.float32) |
| 346 | b = [2, 3, 4] * mult |
| 347 | b = np.array(b, dtype=np.float32) |
| 348 | assert_array_equal(np.invert(in1d(a, b, kind=kind)), |
| 349 | in1d(a, b, invert=True, kind=kind)) |
| 350 | |
| 351 | @pytest.mark.parametrize("kind", [None, "sort", "table"]) |
| 352 | def test_in1d_ravel(self, kind): |
nothing calls this directly
no test coverage detected