Skip to content

Commit

Permalink
improve reliability of get_latest_roots
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Oct 10, 2023
1 parent e069051 commit d36e81a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions caveclient/chunkedgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,12 @@ def suggest_latest_roots(
stop_layer = max(1, stop_layer)

chunks_orig = self.get_leaves(root_id, stop_layer=stop_layer)
while len(chunks_orig) == 0:
stop_layer -= 1
if stop_layer == 1:
raise ValueError(f'There were no children for root_id={root_id} at level 2, something is wrong with the chunkedgraph')
chunks_orig = self.get_leaves(root_id, stop_layer=stop_layer)

chunk_list = np.array(
[
len(
Expand Down

0 comments on commit d36e81a

Please sign in to comment.