'nrn.Segment' object has no attribute 'hname'
As mentioned in title, I encountered this error while running subtree_reductor
Strange, parent() should return a section and not a segment - neuron.yale.edu/neuron/static/py_doc/modelspec/programmatic/topology/secref.html#SectionRef.parent what version of NEURON do you use?
Neuron 7.7.2 I noticed from the link you provided that the syntax is SecRef.parent, without the parenthesis. Might this be an issue?
You are correct, this is probably because your axon is a parent of the soma. Strange, either I expected this use-case but not tested it, or that something in NEURON changed. Anyway, if you can send me a self-contained version of your model I can fix it.
Thanks
Sure. The hoc file I have is really long, because the majority of it is topol(). I can also send you a swc file of the morphology if you want. init_template.zip
Thanks @sunzhenyang2018 but I also need the modfiles