Author: mattip <matti.pi...@gmail.com> Branch: fortran-order Changeset: r80003:07148cce622e Date: 2015-10-06 22:30 +0300 http://bitbucket.org/pypy/pypy/changeset/07148cce622e/
Log: assert order in (CORDER, FORTRANORDER) for implemented arrays, fix failure diff --git a/pypy/module/micronumpy/concrete.py b/pypy/module/micronumpy/concrete.py --- a/pypy/module/micronumpy/concrete.py +++ b/pypy/module/micronumpy/concrete.py @@ -383,6 +383,7 @@ t_strides[i] = base base *= shape[i] backstrides = calc_backstrides(t_strides, shape) + order = support.get_order_as_CF(self.order, order) impl = ConcreteArray(shape, dtype, order, t_strides, backstrides) loop.setslice(space, impl.get_shape(), impl, self) return impl @@ -434,6 +435,8 @@ self.shape = shape # already tested for overflow in from_shape_and_storage self.size = support.product(shape) * dtype.elsize + if order not in (NPY.CORDER, NPY.FORTRANORDER): + raise oefmt(dtype.itemtype.space.w_ValueError, "ConcreteArrayNotOwning but order is not 0,1 rather %d", order) self.order = order self.dtype = dtype self.strides = strides @@ -567,6 +570,8 @@ self.parent = parent self.storage = parent.storage self.gcstruct = parent.gcstruct + if parent.order not in (NPY.CORDER, NPY.FORTRANORDER): + raise oefmt(dtype.itemtype.space.w_ValueError, "SliceArray but parent order is not 0,1 rather %d", parent.order) self.order = parent.order self.dtype = dtype try: _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit