[pypy-commit] pypy numpy-multidim-shards: code cleanup
mattip
noreply at buildbot.pypy.org
Wed Nov 16 00:31:25 CET 2011
Author: mattip
Branch: numpy-multidim-shards
Changeset: r49456:989579c2237f
Date: 2011-11-16 01:30 +0200
http://bitbucket.org/pypy/pypy/changeset/989579c2237f/
Log: code cleanup
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
@@ -173,7 +173,7 @@
#_immutable_fields_ = ['shape[*]', "shards[*]", "backshards[*]", 'start']
shards = None
- start = 0
+ start = 0
def __init__(self, shape):
self.invalidates = []
@@ -400,7 +400,7 @@
firstSlice = NDimSlice(self, self.signature, 0, [3, ], [2, ], [3, ])
builder.append(firstSlice.to_str(comma, builder, indent))
builder.append(',' * comma + ' ..., ')
- lastSlice = NDimSlice(self, self.signature,
+ lastSlice = NDimSlice(self, self.signature,
self.backshards[0] - 2 * self.shards[0], [3, ], [2, ], [3, ])
builder.append(lastSlice.to_str(comma, builder, indent))
else:
@@ -550,7 +550,7 @@
return NDimSlice(self, new_sig, start, shards, backshards, shape)
def descr_mean(self, space):
- return space.wrap(space.float_w(self.descr_sum(space))/self.find_size())
+ return space.wrap(space.float_w(self.descr_sum(space)) / self.find_size())
def descr_nonzero(self, space):
try:
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
@@ -20,7 +20,7 @@
else:
args_w.append(arg)
return self.space.newtuple(args_w)
-
+
def test_shards(self):
a = NDimArray(100, [10, 5, 3], MockDtype())
assert a.shards == [15, 3, 1]
More information about the pypy-commit
mailing list