Skip to content

Commit

Permalink
V1.0.0 fixes (#167)
Browse files Browse the repository at this point in the history
* happy pylint (newly added linter)

Now to iterate over a `dict`, the only acceptable way is two call `.items()`

* disable pylint for two lines due to bugs

temporarily disabling pylint as it has an active bug for two lines: pylint-dev/pylint#3675

* fix typo

* happy pylint warnings

* Happy pylint recoms

* fix typo
  • Loading branch information
aafshinfard authored Apr 1, 2021
1 parent 764615f commit fde0cae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions physlr/physlr.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def determine_backbones_of_trees(g, prune_junctions):
for subcomponent in nx.connected_components(gcomponents):
gsubcomponent = g.subgraph(subcomponent)
u, v, _ = Physlr.diameter_of_tree(gsubcomponent, weight="m")
path = nx.shortest_path(gsubcomponent, u, v, weight="m")
path = nx.shortest_path(gsubcomponent, u, v, weight="m") # pylint: disable=E1121, E1123
paths.append(path)
paths.sort(key=len, reverse=True)
print(
Expand Down Expand Up @@ -1178,7 +1178,7 @@ def physlr_mst_troubleshoot(self):
for component in nx.connected_components(gmst):
gcomponent = gmst.subgraph(component)
branch_lengths = Physlr.measure_branch_length(gcomponent)
for u, v in branch_lengths:
for u, v in branch_lengths.items():
gmst[u][v]["l"] = min(branch_lengths[(u, v)], branch_lengths[(v, u)])
print(int(timeit.default_timer() - t0), "Measured branches.", file=sys.stderr, flush=True)

Expand Down Expand Up @@ -1266,7 +1266,7 @@ def physlr_tiling_graph(self):
g = self.read_graph(self.args.FILES)
Physlr.filter_edges(g, self.args.m)
backbones = self.determine_backbones(g)
tiling = {u for path in backbones for u in nx.shortest_path(g, path[0], path[-1])}
tiling = {u for path in backbones for u in nx.shortest_path(g, path[0], path[-1])} # pylint: disable=E1121, E1123
subgraph = g.subgraph(tiling)
self.write_graph(subgraph, sys.stdout, self.args.graph_format)

Expand Down Expand Up @@ -2186,7 +2186,7 @@ def physlr_bed_to_path(self):
orientation = "."
scaffolds.append((tname, tstart, orientation, qname))
scaffolds.sort()
print(int(timeit.default_timer() - t0), f"Ordered and oriented queries.", file=sys.stderr)
print(int(timeit.default_timer() - t0), "Ordered and oriented queries.", file=sys.stderr)

num_scaffolds = 0
num_contigs = 0
Expand Down Expand Up @@ -2432,7 +2432,7 @@ def path_to_fasta_no_arcs(seqs, paths, gaps):
if not path:
continue

all_unoriented = all([name[-1] == "." for name in path])
all_unoriented = all((name[-1] == "." for name in path))
if all_unoriented:
continue

Expand Down

0 comments on commit fde0cae

Please sign in to comment.