summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2023-01-17 17:24:28 -0500
committerGitHub <noreply@github.com>2023-01-17 17:24:28 -0500
commit0013550dccc2de2150dd4c1f92340ed9273a521e (patch)
tree3fa8e9a01cedb3720cc893f69b9f29dca6360b64 /numpy/lib
parent2e6b85d08a2bc5689037f80554cffbe30244227e (diff)
parentff78e59f5a4ff5b4c5fbf58228a6be8dab9480a8 (diff)
downloadnumpy-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.py8
-rw-r--r--numpy/lib/tests/test_shape_base.py4
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)))