[pypy-commit] pypy default: fix argument order to ufunc reduce

bdkearns noreply at buildbot.pypy.org
Thu Oct 9 09:03:52 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r73858:ac6033fa1b3c
Date: 2014-10-09 01:15 -0400
http://bitbucket.org/pypy/pypy/changeset/ac6033fa1b3c/

Log:	fix argument order to ufunc reduce

diff --git a/pypy/module/micronumpy/test/test_ufuncs.py b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -812,6 +812,7 @@
         b = add.reduce(a, 0, keepdims=True)
         assert b.shape == (1, 4)
         assert (add.reduce(a, 0, keepdims=True) == [12, 15, 18, 21]).all()
+        assert (add.reduce(a, 0, None, None, True) == [12, 15, 18, 21]).all()
 
     def test_bitwise(self):
         from numpypy import bitwise_and, bitwise_or, bitwise_xor, arange, array
diff --git a/pypy/module/micronumpy/ufuncs.py b/pypy/module/micronumpy/ufuncs.py
--- a/pypy/module/micronumpy/ufuncs.py
+++ b/pypy/module/micronumpy/ufuncs.py
@@ -102,9 +102,9 @@
         return self.reduce(space, w_obj, w_axis, True, #keepdims must be true
                            out, w_dtype, cumulative=True)
 
-    @unwrap_spec(skipna=bool, keepdims=bool)
+    @unwrap_spec(keepdims=bool)
     def descr_reduce(self, space, w_obj, w_axis=None, w_dtype=None,
-                     skipna=False, keepdims=False, w_out=None):
+                     w_out=None, keepdims=False):
         """reduce(...)
         reduce(a, axis=0)
 


More information about the pypy-commit mailing list