Skip to content

Commit

Permalink
feat(neuroml): simplify looking for segment parent's section
Browse files Browse the repository at this point in the history
The same segment objects are used everywhere, so the segment object in
`parent_seg` will also be the one used in the lists in `ordered_segs`.
So, there's no need to iterate and compare ids, simply look if the
object is in the list.
  • Loading branch information
sanjayankur31 committed Sep 11, 2024
1 parent 3612bf0 commit 3b79d06
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions netpyne/conversion/neuromlFormat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,11 +1448,8 @@ def handle_population(
seg.parent.segments
]
parent_sec = None
# TODO: optimise
for sec in ordered_segs.keys():
if parent_seg.id in [
s.id for s in ordered_segs[sec]
]:
for sec, segments in ordered_segs:
if parent_seg in segments:
parent_sec = sec
break

Expand Down

0 comments on commit 3b79d06

Please sign in to comment.