diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-05-10 15:06:37 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-05-10 15:06:37 -0700 |
commit | f39df4844617f573adce33def5785f535274707a (patch) | |
tree | 796bf38feff5650b48a0bb4829f847c449b6d267 | |
parent | 6c8c22e41e3129c2e35e78fe6d6d73436fda8d65 (diff) | |
parent | 2a2f91f3b9f28abfb5c065502fbdfffa5afbdd9f (diff) | |
download | numpy-f39df4844617f573adce33def5785f535274707a.tar.gz |
Merge pull request #3325 from seberg/remove-gh-356-special-case
MAINT: Remove unnecessary 0-d special case.
-rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 12 | ||||
-rw-r--r-- | numpy/core/tests/test_ufunc.py | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index 7cdcf304e..4fac30b5a 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -2008,18 +2008,6 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc, NPY_ITER_NO_BROADCAST; } - /* - * If there are no iteration dimensions, create a fake one - * so that the scalar edge case works right. - */ - if (iter_ndim == 0) { - iter_ndim = 1; - iter_shape[0] = 1; - for (i = 0; i < nop; ++i) { - op_axes[i][0] = -1; - } - } - iter_flags = ufunc->iter_flags | NPY_ITER_MULTI_INDEX | NPY_ITER_REFS_OK | diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py index c969fa8ac..a59db5562 100644 --- a/numpy/core/tests/test_ufunc.py +++ b/numpy/core/tests/test_ufunc.py @@ -795,5 +795,11 @@ class TestUfunc(TestCase): assert_equal(a, np.array([[0,2,4,3],[7,9,11,7], [14,16,18,11],[12,13,14,15]], dtype='i8')) + a = np.array(0) + opflag_tests.inplace_add(a, 3) + assert_equal(a, 3) + opflag_tests.inplace_add(a, [3, 4]) + assert_equal(a, 10) + if __name__ == "__main__": run_module_suite() |