Skip to content

Commit

Permalink
PEP8: Fix E702 multiple statements on one line (semicolon)
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed Apr 12, 2013
1 parent e4b28cf commit dd398e7
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 14 deletions.
3 changes: 2 additions & 1 deletion scipy/sparse/linalg/isolve/lsqr.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ def lsqr(A, b, damp=0.0, atol=1e-8, btol=1e-8, conlim=1e8,
if show:
print(' ')
print(head1, head2)
test1 = 1; test2 = alfa / beta;
test1 = 1
test2 = alfa / beta
str1 = '%6g %12.5e' %( itn, x[0] )
str2 = ' %10.3e %10.3e'%( r1norm, r2norm )
str3 = ' %8.1e %8.1e' %( test1, test2 )
Expand Down
24 changes: 18 additions & 6 deletions scipy/sparse/linalg/isolve/minres.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ def minres(A, b, x0=None, shift=0.0, tol=1e-5, maxiter=None, xtype=None,
print(first + 'itnlim = %3g rtol = %11.2e' % (maxiter,tol))
print()

istop = 0; itn = 0; Anorm = 0; Acond = 0;
rnorm = 0; ynorm = 0;
istop = 0
itn = 0
Anorm = 0
Acond = 0
rnorm = 0
ynorm = 0

xtype = x.dtype

Expand Down Expand Up @@ -126,10 +130,18 @@ def minres(A, b, x0=None, shift=0.0, tol=1e-5, maxiter=None, xtype=None,


# Initialize other quantities
oldb = 0; beta = beta1; dbar = 0; epsln = 0;
qrnorm = beta1; phibar = beta1; rhs1 = beta1;
rhs2 = 0; tnorm2 = 0; ynorm2 = 0;
cs = -1; sn = 0;
oldb = 0
beta = beta1
dbar = 0
epsln = 0
qrnorm = beta1
phibar = beta1
rhs1 = beta1
rhs2 = 0
tnorm2 = 0
ynorm2 = 0
cs = -1
sn = 0
w = zeros(n, dtype=xtype)
w2 = zeros(n, dtype=xtype)
r2 = r1
Expand Down
3 changes: 2 additions & 1 deletion scipy/sparse/linalg/isolve/tests/test_lsmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ def lsmrtest(m, n, damp):
x, istop, itn, normr, normar, norma, conda, normx \
= lsmr(A, b, damp, atol, btol, conlim, itnlim, show )

j1 = min(n,5); j2 = max(n-4,1);
j1 = min(n,5)
j2 = max(n-4,1)
print(' ')
print('First elements of x:')
str = [ '%10.4f' %(xi) for xi in x[0:j1] ]
Expand Down
8 changes: 6 additions & 2 deletions scipy/stats/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5519,7 +5519,9 @@ def _drv2_ppfsingle(self, q, *args): # Use basic bisection algorithm
if isinf(b): # Be sure ending point is > q
b = int(max(100*q,10))
while 1:
if b >= self.b: qb = 1.0; break
if b >= self.b:
qb = 1.0
break
qb = self._cdf(b,*args)
if (qb < q): b += 10
else: break
Expand All @@ -5528,7 +5530,9 @@ def _drv2_ppfsingle(self, q, *args): # Use basic bisection algorithm
if isinf(a): # be sure starting point < q
a = int(min(-100*q,-10))
while 1:
if a <= self.a: qb = 0.0; break
if a <= self.a:
qb = 0.0
break
qa = self._cdf(a,*args)
if (qa > q): a -= 10
else: break
Expand Down
3 changes: 2 additions & 1 deletion scipy/weave/examples/binary_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def c_array_int_search(seq,t):
pass

def py_int_search(seq, t):
min = 0; max = len(seq) - 1
min = 0
max = len(seq) - 1
while 1:
if max < min:
return -1
Expand Down
3 changes: 2 additions & 1 deletion scipy/weave/size_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def __setitem__(self,indices,val):
def __len__(self):
return self.shape[0]
def __getslice__(self,i,j):
i = max(i, 0); j = max(j, 0)
i = max(i, 0)
j = max(j, 0)
return self.__getitem__((slice(i,j),))
def __getitem__(self,indices):
# ayeyaya this is a mess
Expand Down
3 changes: 2 additions & 1 deletion scipy/weave/tests/test_ext_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def test_with_include(self):
@dec.slow
def test_string_and_int(self):
# decalaring variables
a = 2;b = 'string'
a = 2
b = 'string'
# declare module
mod = ext_tools.ext_module('ext_string_and_int')
code = """
Expand Down
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,E22,E23,E24,E25,E26,E271,E3,E5,E701,E702,E71,E72
ignore = E12,E20,E21,E22,E23,E24,E25,E26,E271,E3,E5,E701,E71,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 dd398e7

Please sign in to comment.