diff options
author | MilesCranmer <miles.cranmer@gmail.com> | 2022-06-10 20:28:10 -0400 |
---|---|---|
committer | MilesCranmer <miles.cranmer@gmail.com> | 2022-06-10 20:28:10 -0400 |
commit | 6d91753cfbc95c9968262c8bc0a3ffc9c184cb01 (patch) | |
tree | c6788a1c5df34c6ac98713bc369bda8d153f2580 /numpy/lib/tests/test_arraysetops.py | |
parent | 1ef3737e526c57bc117343a680274f0dac33a126 (diff) | |
download | numpy-6d91753cfbc95c9968262c8bc0a3ffc9c184cb01.tar.gz |
MAINT: Add back in1d tests of old method
Diffstat (limited to 'numpy/lib/tests/test_arraysetops.py')
-rw-r--r-- | numpy/lib/tests/test_arraysetops.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py index d54ca1673..3dc125734 100644 --- a/numpy/lib/tests/test_arraysetops.py +++ b/numpy/lib/tests/test_arraysetops.py @@ -258,21 +258,21 @@ class TestSetOps: ec = np.array([True, False, True, True]) c = in1d(a, b, assume_unique=True) assert_array_equal(c, ec) - c = in1d(a, b, assume_unique=True, method="dictionary") + c = in1d(a, b, assume_unique=True, method="sort") assert_array_equal(c, ec) a[0] = 8 ec = np.array([False, False, True, True]) c = in1d(a, b, assume_unique=True) assert_array_equal(c, ec) - c = in1d(a, b, assume_unique=True, method="dictionary") + c = in1d(a, b, assume_unique=True, method="sort") assert_array_equal(c, ec) a[0], a[3] = 4, 8 ec = np.array([True, False, True, False]) c = in1d(a, b, assume_unique=True) assert_array_equal(c, ec) - c = in1d(a, b, assume_unique=True, method="dictionary") + c = in1d(a, b, assume_unique=True, method="sort") assert_array_equal(c, ec) a = np.array([5, 4, 5, 3, 4, 4, 3, 4, 3, 5, 2, 1, 5, 5]) @@ -281,7 +281,7 @@ class TestSetOps: False, True, False, False, False] c = in1d(a, b) assert_array_equal(c, ec) - c = in1d(a, b, method="dictionary") + c = in1d(a, b, method="sort") assert_array_equal(c, ec) b = b + [5, 5, 4] * mult @@ -289,7 +289,7 @@ class TestSetOps: True, False, True, True] c = in1d(a, b) assert_array_equal(c, ec) - c = in1d(a, b, method="dictionary") + c = in1d(a, b, method="sort") assert_array_equal(c, ec) a = np.array([5, 7, 1, 2]) @@ -297,7 +297,7 @@ class TestSetOps: ec = np.array([True, False, True, True]) c = in1d(a, b) assert_array_equal(c, ec) - c = in1d(a, b, method="dictionary") + c = in1d(a, b, method="sort") assert_array_equal(c, ec) a = np.array([5, 7, 1, 1, 2]) @@ -305,7 +305,7 @@ class TestSetOps: ec = np.array([True, False, True, True, True]) c = in1d(a, b) assert_array_equal(c, ec) - c = in1d(a, b, method="dictionary") + c = in1d(a, b, method="sort") assert_array_equal(c, ec) a = np.array([5, 5]) @@ -313,7 +313,7 @@ class TestSetOps: ec = np.array([False, False]) c = in1d(a, b) assert_array_equal(c, ec) - c = in1d(a, b, method="dictionary") + c = in1d(a, b, method="sort") assert_array_equal(c, ec) a = np.array([5]) @@ -321,7 +321,7 @@ class TestSetOps: ec = np.array([False]) c = in1d(a, b) assert_array_equal(c, ec) - c = in1d(a, b, method="dictionary") + c = in1d(a, b, method="sort") assert_array_equal(c, ec) assert_array_equal(in1d([], []), []) @@ -413,7 +413,7 @@ class TestSetOps: b = [2, 3, 4] * mult assert_array_equal(np.invert(in1d(a, b)), in1d(a, b, invert=True)) assert_array_equal(np.invert(in1d(a, b)), - in1d(a, b, invert=True, method="dictionary")) + in1d(a, b, invert=True, method="sort")) for mult in (1, 10): a = np.array([5, 4, 5, 3, 4, 4, 3, 4, 3, 5, 2, 1, 5, 5], @@ -422,7 +422,7 @@ class TestSetOps: b = np.array(b, dtype=np.float32) assert_array_equal(np.invert(in1d(a, b)), in1d(a, b, invert=True)) assert_array_equal(np.invert(in1d(a, b)), - in1d(a, b, invert=True, method="dictionary")) + in1d(a, b, invert=True, method="sort")) def test_in1d_ravel(self): # Test that in1d ravels its input arrays. This is not documented @@ -436,16 +436,16 @@ class TestSetOps: assert_array_equal(in1d(a, b, assume_unique=False), ec) assert_array_equal(in1d(a, long_b, assume_unique=True), ec) assert_array_equal(in1d(a, long_b, assume_unique=False), ec) - assert_array_equal(in1d(a, b, assume_unique=True, method="dictionary"), + assert_array_equal(in1d(a, b, assume_unique=True, method="sort"), ec) assert_array_equal(in1d(a, b, assume_unique=False, - method="dictionary"), + method="sort"), ec) assert_array_equal(in1d(a, long_b, assume_unique=True, - method="dictionary"), + method="sort"), ec) assert_array_equal(in1d(a, long_b, assume_unique=False, - method="dictionary"), + method="sort"), ec) def test_in1d_hit_alternate_algorithm(self): @@ -472,11 +472,11 @@ class TestSetOps: assert_array_equal(expected, in1d(a, b)) assert_array_equal(expected, - in1d(a, b, method="dictionary")) + in1d(a, b, method="sort")) assert_array_equal(np.invert(expected), in1d(a, b, invert=True)) assert_array_equal(np.invert(expected), - in1d(a, b, invert=True, method="dictionary")) + in1d(a, b, invert=True, method="sort")) def test_in1d_first_array_is_object(self): ar1 = [None] |