[pypy-commit] pypy numpy-dtype-alt: fix arg{max, min} for int dtypes
alex_gaynor
noreply at buildbot.pypy.org
Wed Aug 24 00:00:15 CEST 2011
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-dtype-alt
Changeset: r46748:48268da1db0b
Date: 2011-08-23 12:33 -0500
http://bitbucket.org/pypy/pypy/changeset/48268da1db0b/
Log: fix arg{max,min} for int dtypes
diff --git a/pypy/module/micronumpy/interp_dtype.py b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -149,6 +149,8 @@
def bool(self, v):
return bool(self.unbox(v))
+ def ne(self, v1, v2):
+ return self.for_computation(self.unbox(v1)) != self.for_computation(self.unbox(v2))
class FloatArithmeticDtype(ArithmaticTypeMixin):
@@ -225,9 +227,6 @@
def arctan(self, v):
return math.atan(v)
- def ne(self, v1, v2):
- return self.unbox(v1) != self.unbox(v2)
-
class IntegerArithmeticDtype(ArithmaticTypeMixin):
_mixin_ = True
diff --git a/pypy/module/micronumpy/test/test_numarray.py b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -447,6 +447,9 @@
b = array([])
raises(ValueError, "b.argmax()")
+ a = array(range(-5, 5))
+ assert a.argmax() == 9
+
def test_argmin(self):
from numpy import array
a = array([-1.2, 3.4, 5.7, -3.0, 2.7])
More information about the pypy-commit
mailing list