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

numpy-svn@scip... numpy-svn@scip...
Sun Apr 18 09:02:31 CDT 2010


Author: darren.dale
Date: 2010-04-18 09:02:31 -0500 (Sun, 18 Apr 2010)
New Revision: 8351

Modified:
   trunk/numpy/lib/tests/test_ufunclike.py
   trunk/numpy/lib/ufunclike.py
Log:
correct a bug in fix() that was introduced in r8293


Modified: trunk/numpy/lib/tests/test_ufunclike.py
===================================================================
--- trunk/numpy/lib/tests/test_ufunclike.py	2010-04-18 12:52:07 UTC (rev 8350)
+++ trunk/numpy/lib/tests/test_ufunclike.py	2010-04-18 14:02:31 UTC (rev 8351)
@@ -48,6 +48,7 @@
         res = ufl.fix(a, out)
         assert_equal(res, tgt)
         assert_equal(out, tgt)
+        assert_equal(ufl.fix(3.14), 3)
 
     def test_fix_with_subclass(self):
         class MyArray(nx.ndarray):

Modified: trunk/numpy/lib/ufunclike.py
===================================================================
--- trunk/numpy/lib/ufunclike.py	2010-04-18 12:52:07 UTC (rev 8350)
+++ trunk/numpy/lib/ufunclike.py	2010-04-18 14:02:31 UTC (rev 8351)
@@ -44,7 +44,7 @@
     y1 = nx.floor(x)
     y2 = nx.ceil(x)
     if y is None:
-        y = y1
+        y = nx.asanyarray(y1)
     y[...] = nx.where(x >= 0, y1, y2)
     return y
 



More information about the Numpy-svn mailing list