For example, the following minimal python code only returns either 0, 0.5, or 1.0 fractions.
Code: Select all
from neuron import h, gui soma = h.Section() soma.nseg = 10 h.NetCon(soma(0)._ref_v,None).preloc() # OK - returns 0 h.NetCon(soma(1)._ref_v,None).preloc() # OK - returns 1.0 h.NetCon(soma(0.5)._ref_v,None).preloc() # OK - returns 0.5 h.NetCon(soma(0.25)._ref_v,None).preloc() # Problem - returns 0.5 instead of 0.25 h.NetCon(soma(0.75)._ref_v,None).preloc() # Problem - returns 0.5 instead of 0.75
https://neuron.yale.edu/neuron/static/p ... Con.preloc
Given the above limitation of preloc(), is there any other way to obtain the actual along pre-section fraction that was originally used when creating the NetCon instance?Warning: The return value of x is .5 unless the source is a membrane potential and located at 0, or 1, in which case value returned is 0 or 1, respectively. Therefore it does not necessarily correspond to the actual x value location.
Note: In my use case, I'm comparing a sizable number of models created by others, and modifying the original models to keep track of the along fractions would not be practical.