Page 1 of 1

Creating sections and inserting mechanisms

Posted: Thu Nov 20, 2008 8:40 am
by mattions
I'm wondering if it is possible to create a section in a way it's not anonymous.

for example

Code: Select all

 soma = h.Section()
create an anonymous section

it would be cool to have something like

Code: Select all

soma = h.Section(name='soma')
so when I run topology, or any other tool that display the name of the section I have a better name than the Python one (e.g.: PySec_b7dfa1a0)

Second question is:

Is the blessed way to insert a Mechanism the following?

Code: Select all

h('insert MyMech')
The way proposed here: http://www.davison.webfactional.com/not ... on-python/
does not work.

Cheers,
Michele

Re: Creating sections and inserting mechanisms

Posted: Thu Nov 20, 2008 11:33 am
by mattions
I found that it's possible to insert the mechanism using the section

Code: Select all

soma = h.Section()
soma.insert('MyMech')
It makes sense :)

Re: Creating sections and inserting mechanisms

Posted: Thu Nov 20, 2008 11:42 am
by hines
At present the only way to create a named section with a Python reference is with

Code: Select all

from neuron import h
h('create axon')
h('access axon')
a = h.cas()
print a.name()

Re: Creating sections and inserting mechanisms

Posted: Tue Nov 25, 2008 6:48 am
by mattions
More on the insert mechanism.

Actually I've confused the insert a point process mechanism (like an IClamp) with the instead a diffuse mechanism (like n HH channel)

The synatax proposed here is perfectly working.

Sorry my bad.
http://www.davison.webfactional.com/not ... on-python/