diff options
| author | Charles Harris <charlesr.harris@gmail.com> | 2023-01-17 17:24:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-17 17:24:28 -0500 |
| commit | 0013550dccc2de2150dd4c1f92340ed9273a521e (patch) | |
| tree | 3fa8e9a01cedb3720cc893f69b9f29dca6360b64 /numpy/lib | |
| parent | 2e6b85d08a2bc5689037f80554cffbe30244227e (diff) | |
| parent | ff78e59f5a4ff5b4c5fbf58228a6be8dab9480a8 (diff) | |
| download | numpy-0013550dccc2de2150dd4c1f92340ed9273a521e.tar.gz | |
Merge pull request #23019 from seberg/finalize-non-sequence-stack
DEP: Finalize the non-sequence stacking deprecation
Diffstat (limited to 'numpy/lib')
| -rw-r--r-- | numpy/lib/shape_base.py | 8 | ||||
| -rw-r--r-- | numpy/lib/tests/test_shape_base.py | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py index 3cb4dc19c..154faa1dd 100644 --- a/numpy/lib/shape_base.py +++ b/numpy/lib/shape_base.py @@ -644,8 +644,8 @@ def column_stack(tup): """ if not overrides.ARRAY_FUNCTION_ENABLED: - # raise warning if necessary - _arrays_for_stack_dispatcher(tup, stacklevel=2) + # reject non-sequences (and make tuple) + tup = _arrays_for_stack_dispatcher(tup) arrays = [] for v in tup: @@ -714,8 +714,8 @@ def dstack(tup): """ if not overrides.ARRAY_FUNCTION_ENABLED: - # raise warning if necessary - _arrays_for_stack_dispatcher(tup, stacklevel=2) + # reject non-sequences (and make tuple) + tup = _arrays_for_stack_dispatcher(tup) arrs = atleast_3d(*tup) if not isinstance(arrs, list): diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py index 76058cf20..eb6628904 100644 --- a/numpy/lib/tests/test_shape_base.py +++ b/numpy/lib/tests/test_shape_base.py @@ -492,7 +492,7 @@ class TestColumnStack: assert_equal(actual, expected) def test_generator(self): - with assert_warns(FutureWarning): + with pytest.raises(TypeError, match="arrays to stack must be"): column_stack((np.arange(3) for _ in range(2))) @@ -529,7 +529,7 @@ class TestDstack: assert_array_equal(res, desired) def test_generator(self): - with assert_warns(FutureWarning): + with pytest.raises(TypeError, match="arrays to stack must be"): dstack((np.arange(3) for _ in range(2))) |
