[pypy-commit] pypy numpy-back-to-applevel: minor improvements

fijal noreply at buildbot.pypy.org
Mon Jan 23 22:49:39 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-back-to-applevel
Changeset: r51697:9c6ebf53fca0
Date: 2012-01-23 23:47 +0200
http://bitbucket.org/pypy/pypy/changeset/9c6ebf53fca0/

Log:	minor improvements

diff --git a/lib_pypy/numpypy/core/arrayprint.py b/lib_pypy/numpypy/core/arrayprint.py
--- a/lib_pypy/numpypy/core/arrayprint.py
+++ b/lib_pypy/numpypy/core/arrayprint.py
@@ -551,7 +551,8 @@
 
     def fillFormat(self, data):
         import numeric as _nc
-        errstate = _nc.seterr(all='ignore')
+        # XXX pypy unimplemented
+        #errstate = _nc.seterr(all='ignore')
         try:
             special = isnan(data) | isinf(data) | isna(data)
             special[isna(data)] = False
@@ -570,7 +571,9 @@
                                            or max_val/min_val > 1000.):
                     self.exp_format = True
         finally:
-            _nc.seterr(**errstate)
+            pass
+            # XXX pypy unimplemented
+            #_nc.seterr(**errstate)
 
         if self.exp_format:
             self.large_exponent = 0 < min_val < 1e-99 or max_val >= 1e100
diff --git a/pypy/module/micronumpy/interp_boxes.py b/pypy/module/micronumpy/interp_boxes.py
--- a/pypy/module/micronumpy/interp_boxes.py
+++ b/pypy/module/micronumpy/interp_boxes.py
@@ -283,3 +283,4 @@
 
     __new__ = interp2app(W_Float64Box.descr__new__.im_func),
 )
+
diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -567,7 +567,11 @@
                                       backstrides, shape, concrete))
 
     def descr_ravel(self, space, w_order=None):
-        if not space.is_w(w_order, space.w_None):
+        if space.is_w(w_order, space.w_None):
+            order = 'C'
+        else:
+            order = space.str_w(w_order)
+        if order != 'C':
             raise OperationError(space.w_NotImplementedError, space.wrap(
                 "order not implemented"))
         return self.descr_reshape(space, [space.wrap(-1)])


More information about the pypy-commit mailing list