Several months ago, Mike Neubig suggested that NEURON's usefulness would be greatly enhanced if Python could be used as an alternative interpreter. To this purpose I've started an experimental branch called nrnpython in the cvs repository http://www.neuron.yale.edu/cgi-bin/cvspage.cgi and have gotten to the point where I now believe it can feasibly be carried off with reasonable effort.
Where I am is that on linux, mswin, and mac os x I can run
Code: Select all
neurondemo -python
Code: Select all
nrnpython("any python command")
Code: Select all
from nrn import execute
execute('load_file("nrngui.hoc")') #or any other hoc statement
# starts a usable NEURONMainMenu
For example, in hoc one can say
Code: Select all
forall if (ismembrane("hh") for (x, 0){
print secname(), x, v(x), gnabar_hh(x)
}
Code: Select all
import nrn
for sec in nrn.allsec():
if hh in sec.mechanisms():
for x in sec.locations():
print sec.name, x, sec.v(x), sec.hh.gnabar(x)
Code: Select all
print sec.name(), x, sec.v(x), sec.mech("hh").gnabar(x)
Code: Select all
sec.v(x) = -65
I'd like to hear your ideas.
-Michael Hines
Code: Select all