I'm using Python wrapper. Before each run I would like to setup a fresh environment, so I want to remove all objects (sections, iclamps, netstims, point processes). Is there any way to do that?
As indicated in the reference the function h.nrninit() is not helpful, so I see 3 ways:
1. Run each NEURON instance on separated process and then kill it after finish. But how can I do that from Python?
2. Create a h.reset() function which performs: h.quit() and hypothetical new function h.reload()
2. Return a list of all objects and delete them separately in a loop.
Regards the second idea:
- If h.allobjects() return a list of all objects instead of printing them I could remove them.
- Destruction should work with Section (since setting up Python reference to None, eg. sec = None is a recommended way to make deletion)
- I don't know what about other object such as NetStim, IClamp or PointPorcesses?