First off, thank you for taking the time to look into my question.
I am new to scripting in python, but have been working with .hoc and neuron for the last year or so.
I am trying to do something in python that seems elementary, and can be done in the .hoc interpreter with one line of code. I want to set the value of eh (reversal potential for h_ion) across all sections in a preexisting .ses file (containing both a rig and a cell builder) to -38 mV. I have loaded the file into my jupyter notebook and can interact with it using point processes just fine, but cannot figure out how to modify this density mechanism. All the required .mod files have been loaded as well.
In hoc, this could be done with:
Code: Select all
forsec all{eh = -38}
1. Using the dictionary function of section.psection():
Code: Select all
for sec in h.all:
sec.psection()['ions']['h']['eh']=-38
Code: Select all
for sec in h.all:
sec.psection()['ions']['h']['eh'][0]=-38
Then I tried:
2. Iterating through all the sections as such, which returns the class nrn.Mechanism, which I cannot figure out how to modify.
Code: Select all
for sec in h.all:
for seg in sec.allseg():
for mech in seg:
##{some mysterious statement that will allow me to modify the contents of mech}
Let me know if you need to see the actual .ses file to answer this question.
Many thanks again.