Skip to content

Commit

Permalink
fix(nml): get-segment-info stop when reached cell root
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayankur31 committed Oct 16, 2024
1 parent 7a79870 commit f5c189b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
9 changes: 7 additions & 2 deletions neuroml/nml/helper_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -2471,8 +2471,13 @@ def get_segment_location_info(self, seg_id):
sg_root = current
current = parent
parent = list(graph.predecessors(current))[0]
children = list(graph.successors(parent))
try:
parent = list(graph.predecessors(current))[0]
children = list(graph.successors(parent))
# if reached root, this will error because root has no
# predecessors, so we break
except IndexError:
break
distance_from_bpt = self.get_distance(seg_id, source=current)
else:
Expand Down
11 changes: 8 additions & 3 deletions neuroml/nml/nml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

#
# Generated Fri Sep 13 14:23:30 2024 by generateDS.py version 2.44.1.
# Generated Wed Oct 16 16:26:54 2024 by generateDS.py version 2.44.1.
# Python 3.11.10 (main, Sep 9 2024, 00:00:00) [GCC 14.2.1 20240801 (Red Hat 14.2.1-1)]
#
# Command line options:
Expand Down Expand Up @@ -50047,8 +50047,13 @@ def get_segment_location_info(self, seg_id):
sg_root = current

current = parent
parent = list(graph.predecessors(current))[0]
children = list(graph.successors(parent))
try:
parent = list(graph.predecessors(current))[0]
children = list(graph.successors(parent))
# if reached root, this will error because root has no
# predecessors, so we break
except IndexError:
break

distance_from_bpt = self.get_distance(seg_id, source=current)
else:
Expand Down

0 comments on commit f5c189b

Please sign in to comment.