Author: Maciej Fijalkowski <fij...@gmail.com> Branch: Changeset: r50205:ea4102860b98 Date: 2011-12-06 10:55 +0200 http://bitbucket.org/pypy/pypy/changeset/ea4102860b98/
Log: rename NDimSlice to W_NDimSlice, kill some unused imports 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 @@ -839,10 +839,10 @@ strides += self.strides[s:] backstrides += self.backstrides[s:] new_sig = signature.Signature.find_sig([ - NDimSlice.signature, self.signature, + W_NDimSlice.signature, self.signature, ]) - return NDimSlice(self, new_sig, start, strides[:], backstrides[:], - shape[:]) + return W_NDimSlice(self, new_sig, start, strides[:], backstrides[:], + shape[:]) def descr_reshape(self, space, w_args): """reshape(...) @@ -865,13 +865,13 @@ if new_strides: #We can create a view, strides somehow match up. new_sig = signature.Signature.find_sig([ - NDimSlice.signature, self.signature, ]) + W_NDimSlice.signature, self.signature, ]) ndims = len(new_shape) new_backstrides = [0] * ndims for nd in range(ndims): new_backstrides[nd] = (new_shape[nd] - 1) * new_strides[nd] - arr = NDimSlice(self, new_sig, self.start, new_strides, - new_backstrides, new_shape) + arr = W_NDimSlice(self, new_sig, self.start, new_strides, + new_backstrides, new_shape) else: #Create copy with contiguous data arr = concrete.copy() @@ -894,7 +894,7 @@ if len(concrete.shape) < 2: return space.wrap(self) new_sig = signature.Signature.find_sig([ - NDimSlice.signature, self.signature + W_NDimSlice.signature, self.signature ]) strides = [] backstrides = [] @@ -903,8 +903,8 @@ strides.append(concrete.strides[i]) backstrides.append(concrete.backstrides[i]) shape.append(concrete.shape[i]) - return space.wrap(NDimSlice(concrete, new_sig, self.start, strides[:], - backstrides[:], shape[:])) + return space.wrap(W_NDimSlice(concrete, new_sig, self.start, strides[:], + backstrides[:], shape[:])) def descr_get_flatiter(self, space): return space.wrap(W_FlatIterator(self)) @@ -1204,12 +1204,12 @@ self.backstrides = new_backstrides[:] self.shape = new_shape[:] -class NDimSlice(ViewArray): +class W_NDimSlice(ViewArray): signature = signature.BaseSignature() def __init__(self, parent, signature, start, strides, backstrides, shape): - if isinstance(parent, NDimSlice): + if isinstance(parent, W_NDimSlice): parent = parent.parent ViewArray.__init__(self, parent, signature, strides, backstrides, shape) self.start = start diff --git a/pypy/module/micronumpy/test/test_zjit.py b/pypy/module/micronumpy/test/test_zjit.py --- a/pypy/module/micronumpy/test/test_zjit.py +++ b/pypy/module/micronumpy/test/test_zjit.py @@ -8,13 +8,12 @@ from pypy.jit.metainterp import pyjitpl from pypy.jit.metainterp.test.support import LLJitMixin from pypy.jit.metainterp.warmspot import reset_stats -from pypy.module.micronumpy import interp_boxes, interp_ufuncs, signature -from pypy.module.micronumpy.compile import (numpy_compile, FakeSpace, - FloatObject, IntObject, BoolObject, Parser, InterpreterState) -from pypy.module.micronumpy.interp_numarray import (W_NDimArray, NDimSlice, +from pypy.module.micronumpy import interp_boxes +from pypy.module.micronumpy.compile import (FakeSpace, + IntObject, Parser, InterpreterState) +from pypy.module.micronumpy.interp_numarray import (W_NDimArray, BaseArray) from pypy.rlib.nonconst import NonConstant -from pypy.rpython.annlowlevel import llstr, hlstr class TestNumpyJIt(LLJitMixin): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit