NetCon

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

Moderator: hines

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

NetCon

Post by btorb » Thu Feb 23, 2012 7:51 am

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()
        self.nc = h.NetCon(self.soma(0.5)._ref_v,None,sec=self.soma,threshold=-10)
        self.nc.record(self.SpikesRec)
With the above code the netcon threshold will still be 10mV, the NEURON default. Only by adding

Code: Select all

  self.nc.threshold=0 
the threshold can be changed. According to the documentation (help(h.NetCon)) you should be able to set the threshold directly in the argument

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

Re: NetCon

Post by hines » Thu Feb 23, 2012 11:07 am

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