[Numpy-svn] r6252 - in branches/fix_float_format: . numpy/core/tests

numpy-svn@scip... numpy-svn@scip...
Mon Dec 29 23:14:11 CST 2008


Author: cdavid
Date: 2008-12-29 23:14:08 -0600 (Mon, 29 Dec 2008)
New Revision: 6252

Modified:
   branches/fix_float_format/
   branches/fix_float_format/numpy/core/tests/test_print.py
Log:
Merged revisions 6251 via svnmerge from 
http://svn.scipy.org/svn/numpy/trunk

........
  r6251 | cdavid | 2008-12-30 14:12:50 +0900 (Tue, 30 Dec 2008) | 1 line
  
  Use np.inf instead of float('inf'), as the later does not work on windows for python < 2.6.
........



Property changes on: branches/fix_float_format
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/distutils-revamp:1-2752 /branches/dynamic_cpu_configuration:1-6101 /branches/multicore:1-3687 /branches/numpy-mingw-w64:1-6150 /branches/visualstudio_manifest:1-6077 /trunk:1-6244
   + /branches/distutils-revamp:1-2752 /branches/dynamic_cpu_configuration:1-6101 /branches/multicore:1-3687 /branches/numpy-mingw-w64:1-6150 /branches/visualstudio_manifest:1-6077 /trunk:1-6244,6251

Modified: branches/fix_float_format/numpy/core/tests/test_print.py
===================================================================
--- branches/fix_float_format/numpy/core/tests/test_print.py	2008-12-30 05:12:50 UTC (rev 6251)
+++ branches/fix_float_format/numpy/core/tests/test_print.py	2008-12-30 05:14:08 UTC (rev 6252)
@@ -29,7 +29,7 @@
         yield check_float_type, t
 
 def check_nan_inf_float(tp):
-    for x in [float('inf'), float('-inf'), float('nan')]:
+    for x in [np.inf, -np.inf, np.nan]:
         assert_equal(str(tp(x)), str(float(x)),
                      err_msg='Failed str formatting for type %s' % tp)
 
@@ -88,7 +88,7 @@
                  err_msg='print failed for type%s' % tp)
 
 def check_float_type_print(tp):
-    for x in [0, 1,-1, 1e20, 'inf', 'nan', '-inf'] :
+    for x in [0, 1,-1, 1e20, np.inf, -np.inf, np.nan]
         _test_redirected_print(float(x), tp)
 
     if tp(1e10).itemsize > 4:
@@ -101,8 +101,8 @@
 def check_complex_type_print(tp):
     # We do not create complex with inf/nan directly because the feature is
     # missing in python < 2.6
-    for x in [0, 1, -1, 1e20, complex(float('inf'), 1),
-              complex(float('nan'), 1), complex(float('-inf'), 1)] :
+    for x in [0, 1, -1, 1e20, complex(np.inf, 1),
+              complex(np.nan, 1), complex(-np.inf, 1)] :
         _test_redirected_print(complex(x), tp)
 
     if tp(1e10).itemsize > 8:



More information about the Numpy-svn mailing list