One can wrap a section object within a python class
Code: Select all
from neuron import h, nrn
class NewSection(nrn.Section):
"""
Should wrap a NEURON section
"""
def __init__(self, name="fault"):
"""Initialize the section
"""
nrn.Section.__init__(self, name=name)
Code: Select all
newSec = NewSection(name='something')
newSec.L = 123.4
h.psection(sec=newSec)
Code: Select all
for sec in h.allsec():
print sec.name()
Code: Select all
h.something
Code: Select all
h("print something.L")
Code: Select all
AttributeError: 'hoc.HocObject' object has no attribute 'something'
Code: Select all
NEURON: syntax error
near line 0
print newSec.L
^
Is it a "bug" or a "feature"? For my usage it is a bug because I cannot create a cell model using Python and then type cellmodel.dend10.L to access the section length.
Best,