Skip to content

Commit

Permalink
codequality
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrasmus committed May 18, 2014
1 parent d05cf29 commit 996a03b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
6 changes: 3 additions & 3 deletions argweaver/argweaverc.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@
[POINTER(C.c_int * 2), "path"])
argweaver_get_nstates = export(
argweaverclib, "arghmm_get_nstates", int,
[C.c_void_p, "trees", C.c_int, "ntimes", C.c_bool, "internal",
[C.c_void_p, "trees", C.c_int, "ntimes", C.c_bool, "internal",
C.c_out(C.c_int_list), "nstates"])
get_state_spaces = export(
argweaverclib, "get_state_spaces", POINTER(POINTER(C.c_int * 2)),
[C.c_void_p, "trees", C.c_int, "ntimes", C.c_bool, "internal"])
[C.c_void_p, "trees", C.c_int, "ntimes", C.c_bool, "internal"])
delete_state_spaces = export(
argweaverclib, "delete_state_spaces", C.c_int,
[POINTER(POINTER(C.c_int * 2)), "all_states", C.c_int, "ntrees"])
Expand Down Expand Up @@ -1411,7 +1411,7 @@ def iter_local_ptrees(arg, times, start=None, end=None):

# setup last tree
last_tree2 = tree2
last_ptree, last_nodes, last_nodelookup = ptree, nodes, nodelookup
last_nodes, last_nodelookup = nodes, nodelookup


def get_treeset(arg, times, start=None, end=None):
Expand Down
4 changes: 2 additions & 2 deletions bin/arg-extract-recomb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ for filename in filenames:
avg_treelens = [[s, e, stats.mean(util.cget(group, 2))]
for s, e, group in intervals.iter_intersections(
sorted(util.concat(*treelens)))]
recombs = util.hist_dict(util.concat(*[[t[0] for t in treelen]
for treelen in treelens]))
recombs = util.hist_dict(util.concat(*[[t[0] for t in _treelen]
for _treelen in treelens]))

# Calcuate recombination rate.
recomb_rate = []
Expand Down
14 changes: 13 additions & 1 deletion test/test_codequality.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ def run_pep8(filenames, key=lambda line: True):
"""
Run pep8 and return all errors.
"""
cmd = " ".join(["pep8"] + filenames)

options = []
ignore = []

# E265 block comment should start with '# '
ignore.append('E265')

# E226 missing whitespace around arithmetic operator
ignore.append('E226')

options.extend(['--ignore', ','.join(ignore)])

cmd = " ".join(["pep8"] + options + filenames)
print cmd
pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
lines = [line for line in pipe.stdout if key(line)]
Expand Down

0 comments on commit 996a03b

Please sign in to comment.