Page 1 of 1


Posted: Thu Feb 23, 2012 7:51 am
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

Re: NetCon

Posted: Thu Feb 23, 2012 11:07 am
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.