8000 BUG: allow any axis for np.concatenate for 1D by matthew-brett · Pull Request #440 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: allow any axis for np.concatenate for 1D #440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 24, 2012
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BUG: change FutureWarning to DeprecationWarning
Use of PyErr_WarnEx causing failure for Python 2.4.
  • Loading branch information
matthew-brett committed Sep 16, 2012
commit 4475eadaa879cdc82f5331abc22ab47b99e6b040
8 changes: 5 additions & 3 deletions numpy/core/src/multiarray/multiarraymodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,11 @@ PyArray_ConcatenateArrays(int narrays, PyArrayObject **arrays, int axis)
}

if (ndim == 1 & axis != 0) {
PyErr_WarnEx(PyExc_FutureWarning,
"axis not 0 for ndim == 0; this will raise an error "
"in future versions of numpy", 2);
char msg[] = "axis != 0 for ndim == 1; this will raise an error in "
"future versions of numpy";
if (DEPRECATE(msg) < 0) {
return NULL;
}
axis = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion numpy/core/tests/test_shape_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def test_concatenate_sloppy0():
r4 = list(range(4))
r3 = list(range(3))
assert_array_equal(concatenate((r4, r3), 0), r4 + r3)
warnings.simplefilter('ignore', FutureWarning)
warnings.simplefilter('ignore', DeprecationWarning)
try:
assert_array_equal(concatenate((r4, r3), -10), r4 + r3)
assert_array_equal(concatenate((r4, r3), 10), r4 + r3)
Expand Down
0