Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
run a downloaded model in Neuronvisio
def run_model_in_neuronvisio(model_dir):
if os.path.exists(os.path.join (model_dir, 'mosinit.hoc')):
os.chdir(model_dir)
#TODO: We should check if the file is already compiled,
# and call the right executable according to the system.
call(['nrnivmodl'])
from neuron import gui # to not freeze neuron gui
from neuron import h
from neuronvisio.controls import Controls
controls = Controls() # starting the GUI
h.load_file('mosinit.hoc')
return controls
else:
response = """We didn't find any mosinit.hoc . Unfortunately we can't
automatically run the model. Check the README, maybe there is an
hint."""
print (response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.