Created
September 12, 2011 15:07
-
-
Save mattions/1211511 to your computer and use it in GitHub Desktop.
run a downloaded model in Neuronvisio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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