Skip to content

Commit

Permalink
Fixed bug in merge_multi_sorted_lists
Browse files Browse the repository at this point in the history
  • Loading branch information
niemasd authored Sep 14, 2020
1 parent d898916 commit d3772e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TreeCluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from queue import PriorityQueue,Queue
from treeswift import read_tree_newick
from sys import argv,stderr
VERSION = '1.0.1'
VERSION = '1.0.2'
NUM_THRESH = 1000 # number of thresholds for the threshold-free methods to use
VERBOSE = False

Expand Down Expand Up @@ -37,7 +37,8 @@ def merge_multi_sorted_lists(lists):
while not pq.empty():
d,l = pq.get(); out.append(d)
if inds[l] < len(lists[l]):
pq.put((lists[l][inds[l]],l)); l += 1
pq.put((lists[l][inds[l]],l))
inds[l] += 1
return out

# get the median of a sorted list
Expand Down

0 comments on commit d3772e9

Please sign in to comment.