Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENH all tests now pass with numpy 1.8.0rc1

Bottleneck now requires numpy 1.8.
  • Loading branch information...
commit 9c5038e9824e4a8653bb9130d3b19c381f9fef0d 1 parent 3a38e76
@kwgoodman authored
View
8 README.rst
@@ -2,6 +2,9 @@
Bottleneck
==========
+.. warning::
+ This version of Bottleneck requires NumPy 1.8.
+
Introduction
============
@@ -229,10 +232,13 @@ URLs
Install
=======
+.. warning::
+ This version of Bottleneck requires NumPy 1.8.
+
Requirements:
======================== ====================================================
-Bottleneck Python 2.6, 2.7, 3.3; NumPy 1.5.1, 1.6.2, 1.7.1
+Bottleneck Python 2.6, 2.7, 3.3; NumPy 1.8
Compile gcc or MinGW
Unit tests nose
======================== ====================================================
View
5 RELEASE.rst
@@ -11,6 +11,11 @@ Bottleneck 0.8.0
*Release date: Not yet released, in development*
+This version of Bottleneck requires NumPy 1.8.
+
+**Breaks from 0.7.0**
+- This version of Bottleneck requires NumPy 1.8
+- nanargmin and nanargmax behave like the corresponding functions in NumPy 1.8
Older versions
==============
View
10 bottleneck/slow/func.py
@@ -1,4 +1,4 @@
-
+import warnings
import numpy as np
__all__ = ['median', 'nanmedian', 'nansum', 'nanmean', 'nanvar', 'nanstd',
@@ -111,12 +111,16 @@ def nanmax(arr, axis=None):
def nanargmin(arr, axis=None):
"Slow nanargmin function used for unaccelerated ndim/dtype combinations."
- return np.nanargmin(arr, axis=axis)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore")
+ return np.nanargmin(arr, axis=axis)
def nanargmax(arr, axis=None):
"Slow nanargmax function used for unaccelerated ndim/dtype combinations."
- return np.nanargmax(arr, axis=axis)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore")
+ return np.nanargmax(arr, axis=axis)
def rankdata(arr, axis=None):
View
26,425 bottleneck/src/func/func.c
13,426 additions, 12,999 deletions not shown
View
2  bottleneck/src/move/move.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.19.1 on Mon Sep 9 12:58:32 2013 */
+/* Generated by Cython 0.19.1 on Wed Oct 2 13:16:47 2013 */
#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
View
9 bottleneck/src/template/func/nanargmax.py
@@ -41,7 +41,7 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
if allnan == 0:
return np.intp(idx)
else:
- return NAN
+ return np.intp(np.iinfo('intp').min)
"""
loop[2] = """\
if nINDEX1 == 0:
@@ -59,7 +59,7 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
if allnan == 0:
y[INDEXPOP] = idx
else:
- raise ValueError(CANNOTCONVERT)
+ y[INDEXPOP] = np.iinfo('intp').min
return y
"""
loop[3] = """\
@@ -79,7 +79,7 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
if allnan == 0:
y[INDEXPOP] = idx
else:
- raise ValueError(CANNOTCONVERT)
+ y[INDEXPOP] = np.iinfo('intp').min
return y
"""
@@ -156,9 +156,6 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
nanargmax['main'] = '''"nanargmax auto-generated from template"
-CANNOTCONVERT = "Bottleneck copies NumPy bahavior: "
-CANNOTCONVERT += "'cannot convert float NaN to integer'"
-
def nanargmax(arr, axis=None):
"""
Indices of the maximum values along an axis, ignoring NaNs.
View
9 bottleneck/src/template/func/nanargmin.py
@@ -41,7 +41,7 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
if allnan == 0:
return np.intp(idx)
else:
- return NAN
+ return np.intp(np.iinfo('intp').min)
"""
loop[2] = """\
if nINDEX1 == 0:
@@ -59,7 +59,7 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
if allnan == 0:
y[INDEXPOP] = idx
else:
- raise ValueError(CANNOTCONVERT)
+ y[INDEXPOP] = np.iinfo('intp').min
return y
"""
loop[3] = """\
@@ -79,7 +79,7 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
if allnan == 0:
y[INDEXPOP] = idx
else:
- raise ValueError(CANNOTCONVERT)
+ y[INDEXPOP] = np.iinfo('intp').min
return y
"""
@@ -156,9 +156,6 @@ def NAME_NDIMd_DTYPE_axisAXIS(np.ndarray[np.DTYPE_t, ndim=NDIM] a):
nanargmin['main'] = '''"nanargmin auto-generated from template"
-CANNOTCONVERT = "Bottleneck copies NumPy bahavior: "
-CANNOTCONVERT += "'cannot convert float NaN to integer'"
-
def nanargmin(arr, axis=None):
"""
Indices of the minimum values along an axis, ignoring NaNs.
Please sign in to comment.
Something went wrong with that request. Please try again.