How to use a fixed time-step in Python?

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
Yaeger
Posts: 33
Joined: Mon Aug 19, 2013 4:36 pm

How to use a fixed time-step in Python?

Post by Yaeger » Thu Mar 14, 2019 5:59 pm

How do you use a run method with a fixed time-step in python?

ted
Site Admin
Posts: 5633
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: How to use a fixed time-step in Python?

Post by ted » Fri Mar 15, 2019 11:06 am

I like to use NEURON's own standard run library, instead of trying to reinvent it in Python. Also, even though I may be using NEURON as a Python module, I still like to use NEURON's GUI tools for model development and debugging. Consequently, my scripts typically start with

Code: Select all

from neuron import h, gui
Importing NEURON's gui module loads the standard run library and automatically brings up the NEURON Main Menu toolbar. If I don't want to see the toolbar, I start with these two lines instead

Code: Select all

from neuron import h
h.load_file("stdgui.hoc") # doesn't bring up the NEURON Main Menu toolbar
Then, after my model specification, instrumentation, and simulation flow control code has been executed, I can

Code: Select all

h.dt = whatever_time_step_I_want
h.tstop = whatever_simulation_duration_I_want
h.run() # execute a simulation with my specified time step and simulation duration

Yaeger
Posts: 33
Joined: Mon Aug 19, 2013 4:36 pm

Re: How to use a fixed time-step in Python?

Post by Yaeger » Fri Mar 15, 2019 6:20 pm

Thank you Ted!

Post Reply