Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid chaining commands by ";" and ";" at the end of statements.

Fixes PEP8 E702 multiple statements on one line (semicolon)
  • Loading branch information...
commit 145615b416dca374afe539db2320b2238e4e2a6a 1 parent e19c029
@cbrueffer cbrueffer authored
View
30 Bio/NMR/xpktools.py
@@ -68,7 +68,8 @@ def residue_dict(self,index):
# The nucleus should be given as the input argument in the
# same form as it appears in the xpk label line (H1, 15N for example)
- maxres=-1; minres=-1
+ maxres=-1
+ minres=-1
# Cast the data lines into the xpentry class
self.dict={}
@@ -104,12 +105,18 @@ def residue_dict(self,index):
def write_header(self,outfn):
outfile=_try_open_write(outfn)
- outfile.write(self.firstline);outfile.write("\012")
- outfile.write(self.axislabels);outfile.write("\012")
- outfile.write(self.dataset);outfile.write("\012")
- outfile.write(self.sw);outfile.write("\012")
- outfile.write(self.sf);outfile.write("\012")
- outfile.write(self.datalabels);outfile.write("\012")
+ outfile.write(self.firstline)
+ outfile.write("\012")
+ outfile.write(self.axislabels)
+ outfile.write("\012")
+ outfile.write(self.dataset)
+ outfile.write("\012")
+ outfile.write(self.sw)
+ outfile.write("\012")
+ outfile.write(self.sf)
+ outfile.write("\012")
+ outfile.write(self.datalabels)
+ outfile.write("\012")
outfile.close()
def _try_open_read(fn):
@@ -193,7 +200,8 @@ def data_table(fn_list, datalabel, keyatom):
[dict_list,label_line_list]=_read_dicts(fn_list,keyatom)
# Find global max and min residue numbers
- minr=dict_list[0]["minres"]; maxr=dict_list[0]["maxres"]
+ minr=dict_list[0]["minres"]
+ maxr=dict_list[0]["maxres"]
for dictionary in dict_list:
if (maxr < dictionary["maxres"]):
@@ -225,9 +233,11 @@ def _sort_keys(dictionary):
def _read_dicts(fn_list, keyatom):
# Read multiple files into a list of residue dictionaries
- dict_list=[]; datalabel_list=[]
+ dict_list=[]
+ datalabel_list=[]
for fn in fn_list:
- peaklist=Peaklist(fn); dict=peaklist.residue_dict(keyatom)
+ peaklist=Peaklist(fn)
+ dict=peaklist.residue_dict(keyatom)
dict_list.append(dict)
datalabel_list.append(peaklist.datalabels)
View
4 Bio/Nexus/Nexus.py
@@ -733,10 +733,10 @@ def _format(self,options):
def _set(self,options):
- self.set=options;
+ self.set=options
def _options(self,options):
- self.options=options;
+ self.options=options
def _eliminate(self,options):
self.eliminate=options
View
9 Bio/SubsMat/__init__.py
@@ -536,7 +536,8 @@ def two_mat_relative_entropy(mat_1,mat_2,logbase=2,diag=diagALL):
key_list_1 = sorted(mat_1)
key_list_2 = sorted(mat_2)
key_list = []
- sum_ent_1 = 0.; sum_ent_2 = 0.
+ sum_ent_1 = 0.
+ sum_ent_2 = 0.
for i in key_list_1:
if i in key_list_2:
key_list.append(i)
@@ -621,7 +622,8 @@ def two_mat_print(mat_1, mat_2, f=None,alphabet=None,factor_1=1, factor_2=1,
for i in alphabet:
for j in alphabet:
print_mat[i,j] = -999
- diag_1 = {}; diag_2 = {}
+ diag_1 = {}
+ diag_2 = {}
for i in alphabet:
for j in alphabet[:alphabet.index(i)+1]:
if i == j:
@@ -636,7 +638,8 @@ def two_mat_print(mat_1, mat_2, f=None,alphabet=None,factor_1=1, factor_2=1,
mat_2_key = [alphabet[len_alphabet-alphabet.index(key[0])-1],
alphabet[len_alphabet-alphabet.index(key[1])-1]]
# print mat_2_key
- mat_2_key.sort(); mat_2_key = tuple(mat_2_key)
+ mat_2_key.sort()
+ mat_2_key = tuple(mat_2_key)
# print key ,"||", mat_2_key
print_mat[key] = mat_2[mat_2_key]
print_mat[(key[1],key[0])] = mat_1[key]
View
6 Bio/UniGene/__init__.py
@@ -121,7 +121,7 @@ def __init__(self,text=None):
self._init_from_text(text)
def _init_from_text(self,text):
- parts = text.split('; ');
+ parts = text.split('; ')
for part in parts:
key, val = part.split("=")
if key=='CLONE':
@@ -158,7 +158,7 @@ def __init__(self,text=None):
self._init_from_text(text)
def _init_from_text(self,text):
- parts = text.split('; ');
+ parts = text.split('; ')
for part in parts:
key, val = part.split("=")
@@ -187,7 +187,7 @@ def __init__(self,text=None):
self._init_from_text(text)
def _init_from_text(self,text):
- parts = text.split(' ');
+ parts = text.split(' ')
for part in parts:
key, val = part.split("=")
View
2  Scripts/SeqGui/SeqGui.py
@@ -195,7 +195,7 @@ def __init__(self, parent, ID, title):
menu.Append(ID_EXIT, "E&xit", "Terminate the program")
menuBar = wx.MenuBar()
- menuBar.Append(menu, "&File");
+ menuBar.Append(menu, "&File")
self.SetMenuBar(menuBar)
params_panel = ParamsPanel(self, -1)
View
3  Scripts/xbbtools/xbb_blastbg.py
@@ -21,7 +21,8 @@ def RunCommand(self):
self.outfile = tempfile.mktemp()
# make sure outfile exists and is empty
- fid = open(self.outfile,'w+'); fid.close()
+ fid = open(self.outfile,'w+')
+ fid.close()
com = '%s > %s' % (self.command, self.outfile)
View
12 Tests/test_Cluster.py
@@ -205,15 +205,15 @@ def test_clusterdistance(self):
distance = clusterdistance(data, mask=mask, weight=weight,
index1=c1, index2=c2, dist='e',
- method='a', transpose=0);
+ method='a', transpose=0)
self.assertAlmostEqual(distance, 6.650, places=3)
distance = clusterdistance(data, mask=mask, weight=weight,
index1=c1, index2=c3, dist='e',
- method='a', transpose=0);
+ method='a', transpose=0)
self.assertAlmostEqual(distance, 32.508, places=3)
distance = clusterdistance(data, mask=mask, weight=weight,
index1=c2, index2=c3, dist='e',
- method='a', transpose=0);
+ method='a', transpose=0)
self.assertAlmostEqual(distance, 15.118, places=3)
# Second data set
@@ -252,15 +252,15 @@ def test_clusterdistance(self):
distance = clusterdistance(data, mask=mask, weight=weight,
index1=c1, index2=c2, dist='e',
- method='a', transpose=0);
+ method='a', transpose=0)
self.assertAlmostEqual(distance, 5.833, places=3)
distance = clusterdistance(data, mask=mask, weight=weight,
index1=c1, index2=c3, dist='e',
- method='a', transpose=0);
+ method='a', transpose=0)
self.assertAlmostEqual(distance, 3.298, places=3)
distance = clusterdistance(data, mask=mask, weight=weight,
index1=c2, index2=c3, dist='e',
- method='a', transpose=0);
+ method='a', transpose=0)
self.assertAlmostEqual(distance, 0.360, places=3)
View
2  Tests/test_SeqIO_SeqXML.py
@@ -150,7 +150,7 @@ def test_for_errors(self):
"""Handling of corrupt files."""
for filename in corrupt_files:
iterator = SeqIO.parse(filename,"seqxml")
- self.assertRaises(ValueError,iterator.next);
+ self.assertRaises(ValueError,iterator.next)
if __name__ == "__main__":
Please sign in to comment.
Something went wrong with that request. Please try again.