[Numpy-svn] r8308 - in trunk/numpy/lib: . tests

numpy-svn@scip... numpy-svn@scip...
Tue Mar 30 21:26:14 CDT 2010


Author: cdavid
Date: 2010-03-30 21:26:14 -0500 (Tue, 30 Mar 2010)
New Revision: 8308

Modified:
   trunk/numpy/lib/function_base.py
   trunk/numpy/lib/tests/test_function_base.py
Log:
BUG: fix kaiser for M=1.

Modified: trunk/numpy/lib/function_base.py
===================================================================
--- trunk/numpy/lib/function_base.py	2010-03-27 03:56:17 UTC (rev 8307)
+++ trunk/numpy/lib/function_base.py	2010-03-31 02:26:14 UTC (rev 8308)
@@ -2608,6 +2608,8 @@
 
     """
     from numpy.dual import i0
+    if M == 1:
+        return np.array([1.])
     n = arange(0,M)
     alpha = (M-1)/2.0
     return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(float(beta))

Modified: trunk/numpy/lib/tests/test_function_base.py
===================================================================
--- trunk/numpy/lib/tests/test_function_base.py	2010-03-27 03:56:17 UTC (rev 8307)
+++ trunk/numpy/lib/tests/test_function_base.py	2010-03-31 02:26:14 UTC (rev 8308)
@@ -778,7 +778,7 @@
 class TestKaiser(TestCase):
     def test_simple(self):
         assert_almost_equal(kaiser(0, 1.0), array([]))
-        assert isnan(kaiser(1, 1.0))
+        assert isfinite(kaiser(1, 1.0))
         assert_almost_equal(kaiser(2, 1.0), array([ 0.78984831, 0.78984831]))
         assert_almost_equal(kaiser(5, 1.0),
                             array([ 0.78984831, 0.94503323, 1.        ,



More information about the Numpy-svn mailing list