Skip to content

Commit

Permalink
Fix sqrt of negative number crash
Browse files Browse the repository at this point in the history
  • Loading branch information
rrwick committed Aug 20, 2016
1 parent bc818ae commit a576c8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unicycler/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def __init__(self, graph, start, end, middle, repeat):
# We'll use a mean loop count that's weighted by the middle and repeat segment lengths.
self.depth = get_mean_depth(start_seg, end_seg, graph)
loop_count_by_middle = middle_seg.depth / self.depth
loop_count_by_repeat = (repeat_seg.depth - self.depth) / self.depth
loop_count_by_repeat = max((repeat_seg.depth - self.depth) / self.depth, 0.0)
mean_loop_count = weighted_average(loop_count_by_middle, loop_count_by_repeat,
middle_seg.get_length_no_overlap(graph.overlap),
repeat_seg.get_length_no_overlap(graph.overlap))
Expand Down

0 comments on commit a576c8a

Please sign in to comment.