Creating sections and inserting mechanisms

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Creating sections and inserting mechanisms

Post by mattions » Thu Nov 20, 2008 8:40 am

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

mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Re: Creating sections and inserting mechanisms

Post by mattions » Thu Nov 20, 2008 11:33 am

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 :)

hines
Site Admin
Posts: 1580
Joined: Wed May 18, 2005 3:32 pm

Re: Creating sections and inserting mechanisms

Post by hines » Thu Nov 20, 2008 11:42 am

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()

mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Re: Creating sections and inserting mechanisms

Post by mattions » Tue Nov 25, 2008 6:48 am

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/

Post Reply