Test isin's invert parameter
(self, kind)
| 345 | |
| 346 | @pytest.mark.parametrize("kind", [None, "sort", "table"]) |
| 347 | def test_isin_invert(self, kind): |
| 348 | "Test isin's invert parameter" |
| 349 | # We use two different sizes for the b array here to test the |
| 350 | # two different paths in isin(). |
| 351 | for mult in (1, 10): |
| 352 | a = np.array([5, 4, 5, 3, 4, 4, 3, 4, 3, 5, 2, 1, 5, 5]) |
| 353 | b = [2, 3, 4] * mult |
| 354 | assert_array_equal(np.invert(isin(a, b, kind=kind)), |
| 355 | isin(a, b, invert=True, kind=kind)) |
| 356 | |
| 357 | # float: |
| 358 | if kind in {None, "sort"}: |
| 359 | for mult in (1, 10): |
| 360 | a = np.array([5, 4, 5, 3, 4, 4, 3, 4, 3, 5, 2, 1, 5, 5], |
| 361 | dtype=np.float32) |
| 362 | b = [2, 3, 4] * mult |
| 363 | b = np.array(b, dtype=np.float32) |
| 364 | assert_array_equal(np.invert(isin(a, b, kind=kind)), |
| 365 | isin(a, b, invert=True, kind=kind)) |
| 366 | |
| 367 | def test_isin_hit_alternate_algorithm(self): |
| 368 | """Hit the standard isin code with integers""" |
nothing calls this directly
no test coverage detected