It would be convenient for me to have a single function that removes all point processes from a cell. (Context: doing experiments where I inject current in different locations and measure the response across the whole cell). I know, I know, I should just keep track of all my point processes and set them to None, but I think a catch-all function should be possible.
Example:
Code: Select all
# Setup some IClamp
stim1 = h.IClamp()
# Then: I want a function like this:
def removeAllPointProcesses():
for sec in h.allsec():
# find if sec has a point process -- possible with sec.psection()
if sec.psection() has a point process
return variable name of point process
# In this case, if I call:
allPP = soma.psection()["point_processes"]
#It will return:
display(allPP) -->
{'IClamp': {IClamp[0]}}
# But I don't know how to use that information to find the variable 'stim1'
Is this possible? Thanks!