Skip to content

Commit

Permalink
PEP8: Fix E211 whitespace before '('
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed Apr 12, 2013
1 parent a1a6292 commit 58a6d8d
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 49 deletions.
14 changes: 7 additions & 7 deletions scipy/fftpack/benchmarks/bench_pseudo_diffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def random(size):

def direct_diff(x,k=1,period=None):
fx = fft(x)
n = len (fx)
n = len(fx)
if period is None:
period = 2*pi
w = fftfreq(n)*2j*pi/period*n
Expand All @@ -30,7 +30,7 @@ def direct_diff(x,k=1,period=None):

def direct_tilbert(x,h=1,period=None):
fx = fft(x)
n = len (fx)
n = len(fx)
if period is None:
period = 2*pi
w = fftfreq(n)*h*2*pi/period*n
Expand All @@ -41,7 +41,7 @@ def direct_tilbert(x,h=1,period=None):

def direct_hilbert(x):
fx = fft(x)
n = len (fx)
n = len(fx)
w = fftfreq(n)*n
w = 1j*sign(w)
return ifft(w*fx)
Expand Down Expand Up @@ -73,7 +73,7 @@ def bench_random(self):
]:
print('%6s' % size, end=' ')
sys.stdout.flush()
x = arange (size)*2*pi/size
x = arange(size)*2*pi/size
if size<2000:
f = sin(x)*cos(4*x)+exp(sin(3*x))
else:
Expand Down Expand Up @@ -105,7 +105,7 @@ def bench_random(self):
]:
print('%6s' % size, end=' ')
sys.stdout.flush()
x = arange (size)*2*pi/size
x = arange(size)*2*pi/size
if size<2000:
f = sin(x)*cos(4*x)+exp(sin(3*x))
else:
Expand Down Expand Up @@ -136,7 +136,7 @@ def bench_random(self):
]:
print('%6s' % size, end=' ')
sys.stdout.flush()
x = arange (size)*2*pi/size
x = arange(size)*2*pi/size
if size<2000:
f = sin(x)*cos(4*x)+exp(sin(3*x))
else:
Expand Down Expand Up @@ -167,7 +167,7 @@ def bench_random(self):
]:
print('%6s' % size, end=' ')
sys.stdout.flush()
x = arange (size)*2*pi/size
x = arange(size)*2*pi/size
a = 1
if size<2000:
f = sin(x)*cos(4*x)+exp(sin(3*x))
Expand Down
2 changes: 1 addition & 1 deletion scipy/fftpack/fftpack_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
micro = 3


fftpack_version = '%(major)d.%(minor)d.%(micro)d' % (locals ())
fftpack_version = '%(major)d.%(minor)d.%(micro)d' % (locals())
20 changes: 10 additions & 10 deletions scipy/fftpack/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ def test_random_complex(self):
"Output dtype is %s, expected %s" % (y1.dtype, self.cdt))
self.assertTrue(y2.dtype == self.cdt,
"Output dtype is %s, expected %s" % (y2.dtype, self.cdt))
assert_array_almost_equal (y1, x)
assert_array_almost_equal (y2, x)
assert_array_almost_equal(y1, x)
assert_array_almost_equal(y2, x)

def test_random_real(self):
for size in [1,51,111,100,200,64,128,256,1024]:
Expand All @@ -232,8 +232,8 @@ def test_random_real(self):
"Output dtype is %s, expected %s" % (y1.dtype, self.cdt))
self.assertTrue(y2.dtype == self.cdt,
"Output dtype is %s, expected %s" % (y2.dtype, self.cdt))
assert_array_almost_equal (y1, x)
assert_array_almost_equal (y2, x)
assert_array_almost_equal(y1, x)
assert_array_almost_equal(y2, x)

def test_size_accuracy(self):
# Sanity check for the accuracy for prime and non-prime sized inputs
Expand Down Expand Up @@ -353,9 +353,9 @@ def test_random_real(self):
"Output dtype is %s, expected %s" % (y1.dtype, self.rdt))
self.assertTrue(y2.dtype == self.rdt,
"Output dtype is %s, expected %s" % (y2.dtype, self.rdt))
assert_array_almost_equal (y1, x, decimal=self.ndec,
assert_array_almost_equal(y1, x, decimal=self.ndec,
err_msg="size=%d" % size)
assert_array_almost_equal (y2, x, decimal=self.ndec,
assert_array_almost_equal(y2, x, decimal=self.ndec,
err_msg="size=%d" % size)

def test_size_accuracy(self):
Expand Down Expand Up @@ -541,9 +541,9 @@ def test_shape_argument(self):
small_x = [[1,2,3],[4,5,6]]
large_x1 = [[1,2,3,0],[4,5,6,0],[0,0,0,0],[0,0,0,0]]
y = fftn(small_x,shape=(4,4))
assert_array_almost_equal (y,fftn(large_x1))
assert_array_almost_equal(y,fftn(large_x1))
y = fftn(small_x,shape=(3,4))
assert_array_almost_equal (y,fftn(large_x1[:-1]))
assert_array_almost_equal(y,fftn(large_x1[:-1]))

def test_shape_axes_argument(self):
small_x = [[1,2,3],[4,5,6],[7,8,9]]
Expand All @@ -559,9 +559,9 @@ def test_shape_axes_argument(self):
#for i in range(4):
# assert_array_almost_equal (y[:,i],fft(large_x1[:,i]))
y = fftn(small_x,shape=(4,4),axes=(-2,-1))
assert_array_almost_equal (y,fftn(large_x1))
assert_array_almost_equal(y,fftn(large_x1))
y = fftn(small_x,shape=(4,4),axes=(-1,-2))
assert_array_almost_equal (y,swapaxes(\
assert_array_almost_equal(y,swapaxes(\
fftn(swapaxes(large_x1,-1,-2)),-1,-2))

def test_shape_axes_argument2(self):
Expand Down
44 changes: 22 additions & 22 deletions scipy/fftpack/tests/test_pseudo_diffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def random(size):

def direct_diff(x,k=1,period=None):
fx = fft(x)
n = len (fx)
n = len(fx)
if period is None:
period = 2*pi
w = fftfreq(n)*2j*pi/period*n
Expand All @@ -41,7 +41,7 @@ def direct_diff(x,k=1,period=None):

def direct_tilbert(x,h=1,period=None):
fx = fft(x)
n = len (fx)
n = len(fx)
if period is None:
period = 2*pi
w = fftfreq(n)*h*2*pi/period*n
Expand All @@ -52,7 +52,7 @@ def direct_tilbert(x,h=1,period=None):

def direct_itilbert(x,h=1,period=None):
fx = fft(x)
n = len (fx)
n = len(fx)
if period is None:
period = 2*pi
w = fftfreq(n)*h*2*pi/period*n
Expand All @@ -61,7 +61,7 @@ def direct_itilbert(x,h=1,period=None):

def direct_hilbert(x):
fx = fft(x)
n = len (fx)
n = len(fx)
w = fftfreq(n)*n
w = 1j*sign(w)
return ifft(w*fx)
Expand Down Expand Up @@ -156,7 +156,7 @@ def test_int(self):
def test_random_even(self):
for k in [0,2,4,6]:
for n in [60,32,64,56,55]:
f=random ((n,))
f=random((n,))
af=sum(f,axis=0)/n
f=f-af
# zeroing Nyquist mode:
Expand All @@ -168,17 +168,17 @@ def test_random_even(self):
def test_random_odd(self):
for k in [0,1,2,3,4,5,6]:
for n in [33,65,55]:
f=random ((n,))
f=random((n,))
af=sum(f,axis=0)/n
f=f-af
assert_almost_equal(sum(f,axis=0),0.0)
assert_array_almost_equal(diff(diff(f,k),-k),f)
assert_array_almost_equal(diff(diff(f,-k),k),f)

def test_zero_nyquist (self):
def test_zero_nyquist(self):
for k in [0,1,2,3,4,5,6]:
for n in [32,33,64,56,55]:
f=random ((n,))
f=random((n,))
af=sum(f,axis=0)/n
f=f-af
# zeroing Nyquist mode:
Expand All @@ -196,7 +196,7 @@ def test_definition(self):
x = arange(n)*2*pi/n
y = tilbert(sin(x),h)
y1 = direct_tilbert(sin(x),h)
assert_array_almost_equal (y,y1)
assert_array_almost_equal(y,y1)
assert_array_almost_equal(tilbert(sin(x),h),
direct_tilbert(sin(x),h))
assert_array_almost_equal(tilbert(sin(2*x),h),
Expand All @@ -205,7 +205,7 @@ def test_definition(self):
def test_random_even(self):
for h in [0.1,0.5,1,5.5,10]:
for n in [32,64,56]:
f=random ((n,))
f=random((n,))
af=sum(f,axis=0)/n
f=f-af
assert_almost_equal(sum(f,axis=0),0.0)
Expand All @@ -214,7 +214,7 @@ def test_random_even(self):
def test_random_odd(self):
for h in [0.1,0.5,1,5.5,10]:
for n in [33,65,55]:
f=random ((n,))
f=random((n,))
af=sum(f,axis=0)/n
f=f-af
assert_almost_equal(sum(f,axis=0),0.0)
Expand All @@ -230,7 +230,7 @@ def test_definition(self):
x = arange(n)*2*pi/n
y = itilbert(sin(x),h)
y1 = direct_itilbert(sin(x),h)
assert_array_almost_equal (y,y1)
assert_array_almost_equal(y,y1)
assert_array_almost_equal(itilbert(sin(x),h),
direct_itilbert(sin(x),h))
assert_array_almost_equal(itilbert(sin(2*x),h),
Expand All @@ -243,23 +243,23 @@ def test_definition(self):
x = arange(n)*2*pi/n
y = hilbert(sin(x))
y1 = direct_hilbert(sin(x))
assert_array_almost_equal (y,y1)
assert_array_almost_equal(y,y1)
assert_array_almost_equal(hilbert(sin(2*x)),
direct_hilbert(sin(2*x)))

def test_tilbert_relation(self):
for n in [16,17,64,127]:
x = arange(n)*2*pi/n
f = sin (x)+cos (2*x)*sin(x)
f = sin(x)+cos(2*x)*sin(x)
y = hilbert(f)
y1 = direct_hilbert(f)
assert_array_almost_equal (y,y1)
assert_array_almost_equal(y,y1)
y2 = tilbert(f,h=10)
assert_array_almost_equal (y,y2)
assert_array_almost_equal(y,y2)

def test_random_odd(self):
for n in [33,65,55]:
f=random ((n,))
f=random((n,))
af=sum(f,axis=0)/n
f=f-af
assert_almost_equal(sum(f,axis=0),0.0)
Expand All @@ -268,7 +268,7 @@ def test_random_odd(self):

def test_random_even(self):
for n in [32,64,56]:
f=random ((n,))
f=random((n,))
af=sum(f,axis=0)/n
f=f-af
# zeroing Nyquist mode:
Expand All @@ -285,19 +285,19 @@ def test_definition(self):
x = arange(n)*2*pi/n
y = ihilbert(sin(x))
y1 = direct_ihilbert(sin(x))
assert_array_almost_equal (y,y1)
assert_array_almost_equal(y,y1)
assert_array_almost_equal(ihilbert(sin(2*x)),
direct_ihilbert(sin(2*x)))

def test_itilbert_relation(self):
for n in [16,17,64,127]:
x = arange(n)*2*pi/n
f = sin (x)+cos (2*x)*sin(x)
f = sin(x)+cos(2*x)*sin(x)
y = ihilbert(f)
y1 = direct_ihilbert(f)
assert_array_almost_equal (y,y1)
assert_array_almost_equal(y,y1)
y2 = itilbert(f,h=10)
assert_array_almost_equal (y,y2)
assert_array_almost_equal(y,y2)

class TestShift(TestCase):

Expand Down
2 changes: 1 addition & 1 deletion scipy/linalg/linalg_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
minor = 4
micro = 9

linalg_version = '%(major)d.%(minor)d.%(micro)d' % (locals ())
linalg_version = '%(major)d.%(minor)d.%(micro)d' % (locals())
2 changes: 1 addition & 1 deletion scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def lobpcg( A, X,
activeBlockVectorR = as2d( blockVectorR[:,activeMask] )

if iterationNumber > 0:
activeBlockVectorP = as2d( blockVectorP [:,activeMask] )
activeBlockVectorP = as2d( blockVectorP[:,activeMask] )
activeBlockVectorAP = as2d( blockVectorAP[:,activeMask] )
activeBlockVectorBP = as2d( blockVectorBP[:,activeMask] )

Expand Down
2 changes: 1 addition & 1 deletion scipy/stats/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2916,7 +2916,7 @@ def _ppf(self, q, dfn, dfd):
def _stats(self, dfn, dfd):
v2 = asarray(dfd*1.0)
v1 = asarray(dfn*1.0)
mu = where (v2 > 2, v2 / asarray(v2 - 2), inf)
mu = where(v2 > 2, v2 / asarray(v2 - 2), inf)
mu2 = 2*v2*v2*(v2+v1-2)/(v1*(v2-2)**2 * (v2-4))
mu2 = where(v2 > 4, mu2, inf)
g1 = 2*(v2+2*v1-2)/(v2-6)*sqrt((2*v2-4)/(v1*(v2+v1-2)))
Expand Down
4 changes: 2 additions & 2 deletions scipy/weave/build_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,12 @@ class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler):

compiler_type = 'mingw32'

def __init__ (self,
def __init__(self,
verbose=0,
dry_run=0,
force=0):

distutils.cygwinccompiler.CygwinCCompiler.__init__ (self,
distutils.cygwinccompiler.CygwinCCompiler.__init__(self,
verbose,dry_run, force)

# we need to support 3.2 which doesn't match the standard
Expand Down
2 changes: 1 addition & 1 deletion scipy/weave/tests/weave_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def cleanup_temp_dir(d):
# a working version is available.
from distutils.errors import DistutilsFileError
import distutils.file_util
def move_file (src, dst,
def move_file(src, dst,
verbose=0,
dry_run=0):

Expand Down
4 changes: 2 additions & 2 deletions scipy/weave/weave_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

if release_level:
weave_version = '%(major)d.%(minor)d.%(micro)d_%(release_level)s'\
% (locals ())
% (locals())
else:
weave_version = '%(major)d.%(minor)d.%(micro)d'\
% (locals ())
% (locals())
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ commands=python {toxinidir}/tools/test-installed-scipy.py {posargs:}
[pep8]
max_line_length=200
statistics = True
ignore = E12,E20,E21,E221,E222,E225,E226,E227,E23,E24,E26,E271,E3,E5,E701,E712,E72
ignore = E12,E20,E221,E222,E225,E226,E227,E23,E24,E26,E271,E3,E5,E701,E712,E72
exclude = scipy/sparse/linalg/dsolve/umfpack/_umfpack.py,scipy/sparse/sparsetools/bsr.py,scipy/sparse/sparsetools/coo.py,scipy/sparse/sparsetools/csc.py,scipy/sparse/sparsetools/csgraph.py,scipy/sparse/sparsetools/csr.py,scipy/sparse/sparsetools/dia.py

0 comments on commit 58a6d8d

Please sign in to comment.