Vector.record() & RANGE variable of a point process

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

Vector.record() & RANGE variable of a point process

Post by sec6 »

I'm debugging the Python-port of a model originally coded in hoc.
Of course, I'm aiming to get the Python version to generate the same output as the hoc version.
There's still a subtle difference, which I've tracked down to a particular synapse. I need a way to look more closely at that synapse, to find what's going wrong.

My next logical step, I think, is to look at RANGE variables of the synaptic mechanism in both the hoc and Python versions. (I doubt there's a bug in the .mod file itself -- I'm just trying to "corner" my bug into a sufficiently small region of code that I can see it.)

Here is the declaration of the RANGE:

Code: Select all

NEURON {
	POINT_PROCESS GABAa_S
	RANGE C, R, R0, R1, g, Cmax
<snip>
Recording R onto a Vector is easy in hoc ...

Code: Select all

<snip>
Additional mechanisms from files
<snip> myTemplate.tem <snip>
<snip>
oc> objref myVec,mySyn,myCell
oc> load_file("myTemplate.tem")
        1
oc> myCell = new myTemplate()
oc> myCell.soma mySyn = new GABAa_S(0.5)
oc> myVec = new Vector()
oc> myVec.record(&mySyn.R)
        1
oc> 
... but how do I do the same thing in Python?

Code: Select all

>>> import nrn
>>> import neuron
>>> h = neuron.h
>>> h.nrn_load_dll('./i686/.libs/libnrnmech.so')
Additional mechanisms from files
<snip> GABAa_S.mod <snip>
<snip>
>>> h.load_file('./myTemplate.tem')
1.0
>>> myCell = h.myTemplate()
>>> mySyn = h.GABAa_S(0.5,myCell.soma)
>>> myVec = h.Vector()
>>> myVec.record(mySyn._ref_R,sec=myCell.soma)
Traceback (most recent call last):
  File "stdin", line 1, in <module>
TypeError: Hoc pointer error, i is not a hoc variable
>>>
I have no difficulty recording the range variable of a *section* in Python:

Code: Select all

>>> myVec.record(myCell.soma(0.5)._ref_v, sec=myCell.soma)
sec6
Posts: 39
Joined: Sat Mar 15, 2008 10:32 am

Re: Vector.record() & RANGE variable of a point process

Post by sec6 »

Hang on a minute: I just noticed there's apparently a trac ticket for this. Is this the issue that was fixed in revision 2192?
If so, do I need to get the source from the SVN repository, or is it enough to download the latest precompiled installer for the current standard distribution?
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Vector.record() & RANGE variable of a point process

Post by hines »

Yes. That was fixed in
http://www.neuron.yale.edu/cgi-bin/trac ... geset/2192
There have been a flurry of small python fixes which need to be merged into the
distribution to form a bug fix release. I'll probably do that in a week or so.
Post Reply