initbatser.py

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

Moderator: hines

Post Reply
margo.k3008
Posts: 2
Joined: Fri Mar 19, 2021 9:09 am

initbatser.py

Post by margo.k3008 »

Hello everyone,
I am a beginner to NEURON with programming experience (C++, Pascal and a little bit Python).

I am trying to understand how f-i graph can be built and I found the example called initbatser.py
Link for it: https://neuron.yale.edu/neuron/static/c ... tbatser.py
But at the end of that example, there is one line that I don't understand completely.

Code: Select all

from plotfi import plotfi
What is the plotfi and where I can read about it? I clearly understand that it should be a library or other py-file (like cell.py above), but I didn't find any information about that.

I would really appreciate any help. Thank you!
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: initbatser.py

Post by ted »

The programs initbatser.py and initplotfi.py both need to use a procedure called plotfi, but plotfi is not built into Python. Instead, it is a user-written procedure that is defined in plotfi.py, which is in the same directory as initbatser.py and initplotfi.py. The statement
from plotfi import plotfi
is used in initbatser and initplotfi to make Python read plotfi.py so that it discovers what it is supposed to do when it encounters a statement that calls plotfi.

A Python expert might say that plotfi.py is a module that defines the keyword plotfi. Importing modules and keywords that are defined in modules is an important feature of Python. To learn more about modules and import, see https://docs.python.org/3/tutorial/modules.html and https://docs.python.org/3/reference/import.html.
margo.k3008
Posts: 2
Joined: Fri Mar 19, 2021 9:09 am

Re: initbatser.py

Post by margo.k3008 »

Thank you for your reply.

But I can not find that user-written procedure, because I can not find plotfi.py.
I found initbatser.py and initplotfi.py here:
https://neuron.yale.edu/neuron/docs/bat ... lelization
https://neuron.yale.edu/neuron/docs/bul ... initbatpar

If it possible, could you please share with me the right link with plotfi.py?
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: initbatser.py

Post by ted »

Those files are from an exercise that was part of the 2018 NEURON Summer Course. Download and expand this file
https://neuron.yale.edu/ftp/neuron/2018emory/course.zip
and you'll find all the files for that particular exercise in course/bulletin_board_py
Post Reply