Skip to content

Commit

Permalink
bug: set rl on null fragment graphs (#86)
Browse files Browse the repository at this point in the history
Co-authored-by: anna-grim <[email protected]>
  • Loading branch information
anna-grim and anna-grim authored Sep 4, 2024
1 parent 4fee0b2 commit a2178a6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/segmentation_skeleton_metrics/skeleton_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,15 @@ def load_fragments(self):

# Filter fragments
self.fragment_graphs = dict()
n_excepts = 0
for label in self.get_all_graph_labels():
try:
self.fragment_graphs[label] = fragment_graphs[label]
except KeyError as e:
print(f"\nKeyError: {e} not found in the fragment_graphs.")
self.fragment_graphs[label] = nx.Graph()
print("\n# Fragments:", len(self.fragment_graphs))
except KeyError:
self.fragment_graphs[label] = nx.Graph(run_length=0, n_edges=1)
n_excepts += 1
print("\n% Excepts:", n_excepts / len(self.fragment_graphs))
print("# Fragments:", len(self.fragment_graphs) - n_excepts)

# Report Results
t, unit = utils.time_writer(time() - t0)
Expand Down

0 comments on commit a2178a6

Please sign in to comment.