Skip to content

Commit

Permalink
MAINT: more failsafe connection of sections
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak committed May 4, 2021
1 parent 8d269cb commit f2222cc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions hnn_core/cell.py
Expand Up @@ -221,11 +221,15 @@ def _create_sections(self, p_secs):

# Connects sections of THIS cell together.
for connection in topology:
# XXX: risky to use self.soma as default. Unfortunately there isn't
# a dictionary with all the sections (including soma)
parent_sec = self.dends.get(connection[0], self.soma)
if connection[0] == 'soma':
parent_sec = self.soma
else:
parent_sec = self.dends[connection[0]]
if connection[2] == 'soma':
child_sec = self.soma
else:
child_sec = self.dends[connection[1]]
parent_loc = connection[1]
child_sec = self.dends.get(connection[2], self.soma)
child_loc = connection[3]
child_sec.connect(parent_sec, parent_loc, child_loc)

Expand Down

0 comments on commit f2222cc

Please sign in to comment.