NetCon and artificial cell; sec parameter

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

Moderator: hines

Post Reply
sec6
Posts: 39
Joined: Sat Mar 15, 2008 10:32 am

NetCon and artificial cell; sec parameter

Post by sec6 » Sun Jul 13, 2008 2:33 pm

I'm trying -- in Python -- to make a NetCon connection where the presynaptic cell is an artificial neuron.

The normal syntax for creating a NetCon would be something like:

Code: Select all

nc = h.NetCon(preCell.soma(0.5)._ref_v,postMech,sec=preCell.soma)
The artificial cell, however has no '.soma' (nor any other section)
I can change the first argument from:

Code: Select all

preCell.soma(0.5)._ref_v
to:

Code: Select all

preCell
which seems to work OK, but changing the third argument from:

Code: Select all

sec=preCell.soma
to:

Code: Select all

sec=preCell
doesn't work, since preCell is either a cell or a mechanism, depending on how you look at it, but definitely not a section.
Specifically:

Code: Select all

nc = h.NetCon(preCell,postMech,sec=preCell)
gives this error message:

Code: Select all

TypeError: sec is not a Section
What's the correct way to do this?

ted
Site Admin
Posts: 5592
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NetCon and artificial cell; sec parameter

Post by ted » Tue Jul 15, 2008 10:32 am

sec, shmec. If the spike source is an artificial cell, there should be no ambiguity about which section contains the variable that is monitored for threshold crossing, because there aren't any sections. Have you tried
nc = h.NetCon(precell,postMech)
?

sec6
Posts: 39
Joined: Sat Mar 15, 2008 10:32 am

Re: NetCon and artificial cell; sec parameter

Post by sec6 » Wed Jul 16, 2008 5:50 pm

The 'sec' argument is *always* redundant, as far as I can tell, not just when the presynaptic cell is an artificial cell. The sec argument should probably be abolished in some future release (I think I heard Michael Hines say that was his intention) and the present example can be considered further evidence that that should be done.

I considered doing as you suggested, but was afraid to, because (according to an answer to an earlier question) when the sec parameter's omitted, hoc silently assumes whatever's the currently accessed section -- I thought that technique might avoid an error message, while creating a more subtle bug that would bite me later.

However, emboldened by your suggestion, I tried removing the sec argument, and that does *seem* to work OK.

Post Reply