Skip to content

Commit

Permalink
Raise error with more informative message for these outliers
Browse files Browse the repository at this point in the history
  • Loading branch information
e-koch committed Sep 30, 2024
1 parent 8bfaa51 commit 07d38f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fil_finder/length.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ def longest_path(edge_list, nodes, verbose=False,
node_extrema.append((j[0], i))
values.append(j[1])

if len(values) == 0:
raise ValueError("Unable to find maximum path. This is likely a bug. Please"
" report to https://github.com/e-koch/FilFinder.")

max_path_length = max(values)
start, finish = node_extrema[values.index(max_path_length)]
extremum.append([start, finish])
Expand Down Expand Up @@ -829,7 +833,7 @@ def get_weight(pat):

return long_path, long_path_length


def merge_nodes(node, G):
'''
Combine a node into its neighbors.
Expand Down

0 comments on commit 07d38f3

Please sign in to comment.