Skip to content

Commit

Permalink
node_label_sorting: avoid issues if segment list if array not list
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Jul 29, 2024
1 parent 5b9ea64 commit 5471610
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions navis/graph/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1835,17 +1835,17 @@ def node_label_sorting(x: 'core.TreeNeuron',
curr_points = new_points + curr_points

# Translate into segments
node_list = [x.root[0]]
node_list = [x.root[0:]]
# Note that we're inverting here so that the segments are ordered
# proximal -> distal (i.e. root to tips)
seg_dict = {s[0]: s[::-1] for s in _break_segments(x)}

for n in nodes_walked:
# Note that we're skipping the first (proximal) node to avoid double
# counting nodes
node_list += seg_dict[n][1:]
node_list.append(seg_dict[n][1:])

return np.array(node_list)
return np.concatenate(node_list, dtype=int)


def _igraph_to_sparse(graph, weight_attr=None):
Expand Down

0 comments on commit 5471610

Please sign in to comment.