- class SectionList
sl = h.SectionList()
sl = h.SectionList(python_iterable_of_sections)
Class for creating and managing a list of sections. Unlike a regular Python list, a
SectionListallows including sections based on neuronal morphology (e.g. subtrees).
SectionList, then to turn that into a Python list, use
py_list = list(sl); note that iterating over a SectionList is supported, so it may not be neccessary to create a Python list.
The second syntax creates a SectionList from the Python iterable and is equivalent to:
sl = h.SectionList() for sec in python_iterable_of_sections: sl.append(sec)
sectionto the list
n = sl.remove(sec=section)
n = sl.remove(sectionlist)
sectionfrom the list.
sectionlistis present then all the sections in sectionlist are removed from sl.
Returns the number of sections removed.
Appends the sections connected to
section. Note that this includes children connected at position 0 of parent.
To get a (Python) list of a section’s children, use the section’s
childrenmethod. For example:
>>> from neuron import h >>> s = h.Section(name='s') >>> t = h.Section(name='t') >>> u = h.Section(name='u') >>> t.connect(s) t >>> u.connect(s) u >>> t.children()  >>> s.children() [u, t]
Appends the subtree of the
section. (including that one).
To get a (Python) list of a section’s subtree, use the section’s
Appends all sections which have a path to the
section. (including the specified section). The section list has the important property that the sections are in root to leaf order.
To get a (Python) list of a section’s wholetree, use the section’s
Appends all the root sections. Root sections have no parent section. The number of root sections is the number of real cells in the simulation.
n = sl.unique()
Removes all duplicates of sections in the SectionList. I.e. ensures that no section appears more than once. Returns the number of sections references that were removed.
print the names of the sections in the list.
sl.printnames()is approximately equivalent to:
for sec in sl: print(sec)