summaryrefslogtreecommitdiff
path: root/doc/numpybook
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-08-18 11:51:25 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-08-18 11:51:25 -0600
commitfbd6510d58a47ea0d166c48a82793f05425406e4 (patch)
tree330ce703eb02d20f96099c3fe0fc36ae33d4905b /doc/numpybook
parent8ddb0ce0acafe75d78df528b4d2540dfbf4b364d (diff)
downloadnumpy-fbd6510d58a47ea0d166c48a82793f05425406e4.tar.gz
STY: Giant comma spacing fixup.
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
Diffstat (limited to 'doc/numpybook')
-rw-r--r--doc/numpybook/comparison/ctypes/interface.py2
-rw-r--r--doc/numpybook/comparison/timing.py6
-rw-r--r--doc/numpybook/comparison/weave/filter.py2
-rw-r--r--doc/numpybook/comparison/weave/inline.py10
-rw-r--r--doc/numpybook/runcode.py4
5 files changed, 12 insertions, 12 deletions
diff --git a/doc/numpybook/comparison/ctypes/interface.py b/doc/numpybook/comparison/ctypes/interface.py
index 34e34ca71..1fabe3170 100644
--- a/doc/numpybook/comparison/ctypes/interface.py
+++ b/doc/numpybook/comparison/ctypes/interface.py
@@ -49,7 +49,7 @@ def add(a, b):
a = N.require(a, dtype, requires)
b = N.require(b, dtype, requires)
c = N.empty_like(a)
- func(a,b,c,a.size)
+ func(a, b, c, a.size)
return c
def filter2d(a):
diff --git a/doc/numpybook/comparison/timing.py b/doc/numpybook/comparison/timing.py
index 0d47c7eba..1c70b48ac 100644
--- a/doc/numpybook/comparison/timing.py
+++ b/doc/numpybook/comparison/timing.py
@@ -43,7 +43,7 @@ b = N.zeros_like(a)
filter.DFILTER2D(a,b)
"""
-N = [10,20,30,40,50,100,200,300, 400, 500]
+N = [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
res = {}
@@ -57,6 +57,6 @@ for kind in ['f2py']:#['ctypes', 'pyrex', 'weave', 'f2py']:
print(sys.path)
for n in N:
print("%s - %d" % (kind, n))
- t = timeit.Timer(eval('%s_run'%kind), eval('%s_pre %% (%d,%d)'%(kind,n,n)))
- mytime = min(t.repeat(3,100))
+ t = timeit.Timer(eval('%s_run'%kind), eval('%s_pre %% (%d,%d)'%(kind, n, n)))
+ mytime = min(t.repeat(3, 100))
res[kind].append(mytime)
diff --git a/doc/numpybook/comparison/weave/filter.py b/doc/numpybook/comparison/weave/filter.py
index bbdc9ea85..309764c29 100644
--- a/doc/numpybook/comparison/weave/filter.py
+++ b/doc/numpybook/comparison/weave/filter.py
@@ -20,5 +20,5 @@ def filter(a):
}
"""
b = zeros_like(a)
- weave.inline(code,['a','b'])
+ weave.inline(code, ['a', 'b'])
return b
diff --git a/doc/numpybook/comparison/weave/inline.py b/doc/numpybook/comparison/weave/inline.py
index 3906553ed..6e98e6997 100644
--- a/doc/numpybook/comparison/weave/inline.py
+++ b/doc/numpybook/comparison/weave/inline.py
@@ -16,7 +16,7 @@ def example1(a):
results[1] = 4.0;
return_val = results;
"""
- return weave.inline(code,['a'])
+ return weave.inline(code, ['a'])
def arr(a):
if a.ndim != 2:
@@ -36,16 +36,16 @@ def arr(a):
}
"""
b = zeros_like(a)
- weave.inline(code,['a','b'])
+ weave.inline(code, ['a', 'b'])
return b
a = [None]*10
print(example1(a))
print(a)
-a = rand(512,512)
+a = rand(512, 512)
b = arr(a)
-h = [[0.25,0.5,0.25],[0.5,1,0.5],[0.25,0.5,0.25]]
+h = [[0.25, 0.5, 0.25], [0.5, 1, 0.5], [0.25, 0.5, 0.25]]
import scipy.signal as ss
-b2 = ss.convolve(h,a,'same')
+b2 = ss.convolve(h, a, 'same')
diff --git a/doc/numpybook/runcode.py b/doc/numpybook/runcode.py
index 456846cad..c8c532728 100644
--- a/doc/numpybook/runcode.py
+++ b/doc/numpybook/runcode.py
@@ -131,7 +131,7 @@ def runpycode(lyxstr, name='MyCode'):
def main(args):
usage = "%prog {options} filename"
parser = optparse.OptionParser(usage)
- parser.add_option('-n','--name', default='MyCode')
+ parser.add_option('-n', '--name', default='MyCode')
options, args = parser.parse_args(args)
if len(args) < 1:
@@ -143,7 +143,7 @@ def main(args):
fid.close()
print("Processing %s" % options.name)
newstr = runpycode(str, options.name)
- fid = file(args[0],'w')
+ fid = file(args[0], 'w')
fid.write(newstr)
fid.close()