Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'shoyer/fix-nanargmax' into np18

Conflicts:
	README.rst
	RELEASE.rst
  • Loading branch information...
commit 39dd7df4fe30fd6b1424bd13624b6f8f5e783804 2 parents a2a86d1 + 79a5cba
@kwgoodman authored
View
2  README.rst
@@ -237,7 +237,7 @@ Requirements:
======================== ====================================================
Bottleneck Python 2.6, 2.7, 3.3; NumPy 1.8
-Compile gcc or MinGW
+Compile gcc, clang, MinGW
Unit tests nose
======================== ====================================================
View
4 RELEASE.rst
@@ -18,6 +18,10 @@ This version of Bottleneck requires NumPy 1.8.
- This version of Bottleneck requires NumPy 1.8
- nanargmin and nanargmax behave like the corresponding functions in NumPy 1.8
+**Bug fixes**
+
+- nanargmax/nanargmin wrong for redundant max/min values in 1d int arrays
+
Older versions
==============
View
2  bottleneck/src/template/func/nanargmax.py
@@ -98,7 +98,7 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
amax = MINDTYPE
for iINDEX0 in range(nINDEX0):
ai = a[INDEXALL]
- if ai >= amax:
+ if ai > amax:
amax = ai
idx = iINDEX0
return np.intp(idx)
View
2  bottleneck/src/template/func/nanargmin.py
@@ -98,7 +98,7 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
amin = MAXDTYPE
for iINDEX0 in range(nINDEX0):
ai = a[INDEXALL]
- if ai <= amin:
+ if ai < amin:
amin = ai
idx = iINDEX0
return np.intp(idx)
View
2  bottleneck/tests/func_test.py
@@ -27,6 +27,8 @@ def arrays(dtypes=bn.dtypes, nans=True):
a = a.reshape(shape)
yield a
yield -a
+ # nanargmax/nanargmin regression tests
+ yield np.zeros_like(a)
if issubclass(a.dtype.type, np.inexact):
if nans:
for i in range(a.size):
Please sign in to comment.
Something went wrong with that request. Please try again.