[pypy-commit] pypy pypy-pyarray: fix merge

mattip noreply at buildbot.pypy.org
Thu Sep 19 20:27:24 CEST 2013


Author: Matti Picus <matti.picus at gmail.com>
Branch: pypy-pyarray
Changeset: r67008:da74a3028891
Date: 2013-09-19 21:03 +0300
http://bitbucket.org/pypy/pypy/changeset/da74a3028891/

Log:	fix merge

diff --git a/pypy/module/micronumpy/arrayimpl/concrete.py b/pypy/module/micronumpy/arrayimpl/concrete.py
--- a/pypy/module/micronumpy/arrayimpl/concrete.py
+++ b/pypy/module/micronumpy/arrayimpl/concrete.py
@@ -283,7 +283,7 @@
         s = loop.count_all_true_concrete(self)
         box = index_type.itemtype.box
         nd = len(self.get_shape())
-        w_res = W_NDimArray.from_shape(space, [s, nd], index_type)        
+        w_res = W_NDimArray.from_shape(space, [s, nd], index_type)
         loop.nonzero(w_res, self, box)
         w_res = w_res.implementation.swapaxes(space, w_res, 0, 1)
         l_w = [w_res.descr_getitem(space, space.wrap(d)) for d in range(nd)]
@@ -326,17 +326,18 @@
         self.storage = storage
 
     def create_iter(self, shape=None, backward_broadcast=False, require_index=False):
-        if shape is not None and support.product(shape) > support.product(self.get_shape()):
+        if shape is not None and \
+                support.product(shape) > support.product(self.get_shape()):
             r = calculate_broadcast_strides(self.get_strides(),
                                             self.get_backstrides(),
                                             self.get_shape(), shape, backward_broadcast)
             return iter.MultiDimViewIterator(self, self.dtype, self.start, r[0], r[1], shape)
-        
+
         if not require_index:
             return iter.ConcreteArrayIterator(self)
         else:
             if len(self.get_shape()) == 1:
-                return iter.OneDimViewIterator(self, self.dtype, self.start, 
+                return iter.OneDimViewIterator(self, self.dtype, self.start,
                         self.get_strides(), self.get_shape())
             else:
                 return iter.MultiDimViewIterator(self, self.dtype, self.start,
@@ -404,7 +405,8 @@
         loop.fill(self, box.convert_to(self.dtype))
 
     def create_iter(self, shape=None, backward_broadcast=False, require_index=False):
-        if shape is not None and ssupport.product(shape) > support.prodduct(self.get_shape()):
+        if shape is not None and \
+                support.product(shape) > support.product(self.get_shape()):
             r = calculate_broadcast_strides(self.get_strides(),
                                             self.get_backstrides(),
                                             self.get_shape(), shape,
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
@@ -95,8 +95,7 @@
         if idx.get_size() > self.get_size():
             raise OperationError(space.w_ValueError,
                                  space.wrap("index out of range for array"))
-        idx_iter = idx.create_iter()
-        size = loop.count_all_true_iter(idx_iter, idx.get_shape(), idx.get_dtype())
+        size = loop.count_all_true(idx)
         if size > val.get_size() and val.get_size() > 1:
             raise OperationError(space.w_ValueError, space.wrap("NumPy boolean array indexing assignment "
                                                                 "cannot assign %d input values to "


More information about the pypy-commit mailing list