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

Moderator: hines

Post Reply
Posts: 30
Joined: Fri Oct 21, 2005 8:14 am


Post by btorb »

Hi, I just noticed something annoying while setting the threshold of a NetCon in PyNRN.

Code: Select all

    def _initRecordingSpikes(self):
        self.SpikesRec = h.Vector() = h.NetCon(self.soma(0.5)._ref_v,None,sec=self.soma,threshold=-10)
With the above code the netcon threshold will still be 10mV, the NEURON default. Only by adding

Code: Select all 
the threshold can be changed. According to the documentation (help(h.NetCon)) you should be able to set the threshold directly in the argument
Site Admin
Posts: 1603
Joined: Wed May 18, 2005 3:32 pm

Re: NetCon

Post by hines »

Except for the last 'sec=...' named arg to hoc functions and constructors, all arguement are only understood as positional. Other named args are ignored.
I guess the only exception to the above is the h.Section constructor method that allows "cell = ..." and "name = ..." named args.
It would be nice to allow names args as an alternative to positional args. Unfortunately that would require a database of all hoc function prototypes so that
the args passed to hoc functions get marshaled into their proper positional form. I'll look into the possibility of generating an error message when invalid named args are used
to call hoc functions from python.
Post Reply