Author: mattip Branch: numpypy-axisops Changeset: r51005:e27a9330285a Date: 2012-01-04 01:11 +0200 http://bitbucket.org/pypy/pypy/changeset/e27a9330285a/
Log: kill dead code, with an assert and a comment 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 @@ -780,6 +780,8 @@ target_len = self.values.shape[self.dim] #sig = self.find_sig(result.shape) ##Don't do this, infinite recursion sig = self.create_sig(result.shape) + if not isinstance(self.values, W_NDimSlice): + abc=kil ri = ArrayIterator(result.size) si = axis_iter_from_arr(self.values, self.dim) while not ri.done(): diff --git a/pypy/module/micronumpy/signature.py b/pypy/module/micronumpy/signature.py --- a/pypy/module/micronumpy/signature.py +++ b/pypy/module/micronumpy/signature.py @@ -155,7 +155,9 @@ def allocate_iter(self, arr, res_shape, chunklist): if chunklist: - return self.allocate_view_iter(arr, res_shape, chunklist) + #How did we get here? + assert NotImplemented + #return self.allocate_view_iter(arr, res_shape, chunklist) return ArrayIterator(arr.size) def eval(self, frame, arr): diff --git a/pypy/module/micronumpy/test/test_numarray.py b/pypy/module/micronumpy/test/test_numarray.py --- a/pypy/module/micronumpy/test/test_numarray.py +++ b/pypy/module/micronumpy/test/test_numarray.py @@ -743,6 +743,9 @@ assert (a.sum(1) == [3, 12, 21, 30, 39]).all() assert (a.max(0) == [12, 13, 14]).all() assert (a.max(1) == [2, 5, 8, 11, 14]).all() + b = a.copy() + #b should be an array, not a view + assert (b.sum(1) == [3, 12, 21, 30, 39]).all() def test_identity(self): from numpypy import identity, array _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit