Skip to content

Commit

Permalink
PEP8: Fix E271 multiple spaces after keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed Apr 12, 2013
1 parent b5ccb04 commit f269bfb
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion scipy/ndimage/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ def watershed_ift(input, markers, structure=None, output=None):
raise RuntimeError('structure and input must have equal rank')
for ii in structure.shape:
if ii != 3:
raise RuntimeError('structure dimensions must be equal to 3')
raise RuntimeError('structure dimensions must be equal to 3')
if not structure.flags.contiguous:
structure = structure.copy()
markers = numpy.asarray(markers)
Expand Down
4 changes: 2 additions & 2 deletions scipy/optimize/_tstutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def f3(x) :
return x*(x-1.)*(x-2.)*(x-3.)

def f4(x) :
if x > 1 : return 1.0 + .1*x
if x > 1 : return 1.0 + .1*x
if x < 1 : return -1.0 + .1*x
return 0

Expand All @@ -24,7 +24,7 @@ def f5(x) :
return 0

def f6(x) :
if x > 1 : return random()
if x > 1 : return random()
elif x < 1 : return -random()
else : return 0

Expand Down
2 changes: 1 addition & 1 deletion scipy/signal/fir_filter_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def kaiser_beta(a):
----------
Oppenheim, Schafer, "Discrete-Time Signal Processing", p.475-476.
"""
if a > 50:
if a > 50:
beta = 0.1102 * (a - 8.7)
elif a > 21:
beta = 0.5842 * (a - 21) ** 0.4 + 0.07886 * (a - 21)
Expand Down
2 changes: 1 addition & 1 deletion scipy/signal/spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def welch(x, fs=1.0, window='hanning', nperseg=256, noverlap=None, nfft=None,
win = np.asarray(window)
if len(win.shape) != 1:
raise ValueError('window must be 1-D')
if win.shape[0] > x.shape[-1]:
if win.shape[0] > x.shape[-1]:
raise ValueError('window is longer than x.')
nperseg = win.shape[0]

Expand Down
2 changes: 1 addition & 1 deletion scipy/sparse/dok.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get(self, key, default=0.):
raise IndexError('index out of bounds')
return dict.get(self, key, default)

def __getitem__(self, key):
def __getitem__(self, key):
"""If key=(i,j) is a pair of integers, return the corresponding
element. If either i or j is a slice or sequence, return a new sparse
matrix with just these elements.
Expand Down
4 changes: 2 additions & 2 deletions scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def test_symmetric_modes():
for mattype in params.mattypes:
for (sigma, modes) in params.sigmas_modes.items():
for mode in modes:
yield (eval_evec, symmetric, D, typ, k, which,
yield (eval_evec, symmetric, D, typ, k, which,
None, sigma, mattype, None, mode)


Expand All @@ -380,7 +380,7 @@ def test_hermitian_modes():
if which == 'BE': continue # BE invalid for complex
for mattype in params.mattypes:
for sigma in params.sigmas_modes:
yield (eval_evec, symmetric, D, typ, k, which,
yield (eval_evec, symmetric, D, typ, k, which,
None, sigma, mattype)


Expand Down
6 changes: 3 additions & 3 deletions scipy/stats/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,13 +1097,13 @@ def _ppf_single_call(self, q, *args):
right = self.b

factor = 10.
if not left: # i.e. self.a = -inf
if not left: # i.e. self.a = -inf
left = -1.*factor
while self._ppf_to_solve(left, q,*args) > 0.:
right = left
left *= factor
# left is now such that cdf(left) < q
if not right: # i.e. self.b = inf
if not right: # i.e. self.b = inf
right = factor
while self._ppf_to_solve(right, q,*args) < 0.:
left = right
Expand Down Expand Up @@ -2308,7 +2308,7 @@ class bradford_gen(rv_continuous):
"""
def _pdf(self, x, c):
return c / (c*x + 1.0) / log(1.0+c)
return c / (c*x + 1.0) / log(1.0+c)
def _cdf(self, x, c):
return log(1.0+c*x) / log(c+1.0)
def _ppf(self, q, c):
Expand Down
2 changes: 1 addition & 1 deletion scipy/stats/tests/test_discrete_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def check_discrete_chisquare(distfn, arg, rvs, alpha, msg):
distmass = []
for ii in distsupport:
current = distfn.cdf(ii,*arg)
if current - last >= wsupp-1e-14:
if current - last >= wsupp-1e-14:
distsupp.append(ii)
distmass.append(current - last)
last = current
Expand Down
2 changes: 1 addition & 1 deletion scipy/weave/_dumb_shelve.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Some python installations don't have zlib.
pass

import pickle
import pickle

class DbfilenameShelf(Shelf):
"""Shelf implementation using the "anydbm" generic dbm interface.
Expand Down
2 changes: 1 addition & 1 deletion scipy/weave/cpp_namespace_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ft_converter(cpp_namespace_converter):
from __future__ import absolute_import, print_function

from weave import common_info
from weave import base_info
from weave import base_info
from weave.base_spec import base_converter

cpp_support_template = \
Expand Down
2 changes: 1 addition & 1 deletion scipy/weave/ext_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def parse_tuple_code(self):
(format,ref_string)
parse_tuple += ' return NULL;\n'

return declare_return + declare_kwlist + declare_py_objects \
return declare_return + declare_kwlist + declare_py_objects \
+ init_values + parse_tuple

def arg_declaration_code(self):
Expand Down
2 changes: 1 addition & 1 deletion scipy/weave/inline_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def parse_tuple_code(self):
'&py__globals))\n'\
' return NULL;\n'

return declare_return + declare_py_objects + \
return declare_return + declare_py_objects + \
init_values + parse_tuple

def arg_declaration_code(self):
Expand Down
6 changes: 3 additions & 3 deletions scipy/weave/size_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def __getitem__(self,indices):
#if hasattr(step,'value') and type(step.value) != ndarray:
# step = step.value
if beg is None: beg = 0
if end == sys.maxint or end is None:
if end == sys.maxint or end is None:
end = dim_len
if step is None:
step = 1
Expand All @@ -210,9 +210,9 @@ def __getitem__(self,indices):
if end < 0: end = 0
if end > dim_len: end = dim_len
# This is rubbish.
if beg == end:
if beg == end:
beg,end,step = 0,0,1
elif beg >= dim_len and step > 0:
elif beg >= dim_len and step > 0:
beg,end,step = 0,0,1
#elif index.step > 0 and beg <= end:
elif step > 0 and beg <= end:
Expand Down
2 changes: 1 addition & 1 deletion scipy/weave/tests/test_size_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def generic_check(self,expr,desired,**kw):
actual = eval(expr,locals()).shape
except:
actual = 'failed'
if actual is 'failed' and desired is 'failed':
if actual is 'failed' and desired is 'failed':
return
try:
assert_array_equal(actual,desired, expr)
Expand Down
4 changes: 2 additions & 2 deletions 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,E221,E222,E225,E226,E23,E24,E26,E271,E3,E501,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
ignore = E12,E20,E221,E222,E225,E226,E23,E24,E26,E3,E501,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,scipy/__config__.py

0 comments on commit f269bfb

Please sign in to comment.