Skip to content

Instantly share code, notes, and snippets.

@mattions
Created September 12, 2011 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattions/1211511 to your computer and use it in GitHub Desktop.
Save mattions/1211511 to your computer and use it in GitHub Desktop.
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