I’m new to programming and reading through the pylinac documentation I became interested in the log analyzer module. My issue is that I really have no idea where to start in terms of programming for the log analyzer.
My initial interest is to be able to work with the fluences generated from the log files.
Can you import pylinac or do you need to state from pylinac import and then your specific module you want to import?
Basically I’m looking for help understanding the API documentation and how to actually use it for programming. Any examples, links, etc would be greatly appreciated. Thank you.
If you read the documentation I’m sure you came across the log analyzer section, right? There’s a section specifically on fluences and a section describing the API. All of pylinac’s documentation is written to be beginner-friendly. You may also want to read this section on beginners to Python.
Re: import–you can do either style, it’s merely a choice of style. The following are equivalent although the latter is a better practice when you import lots of libraries (to avoid namespace collisions):
`
from pylinac import Dynalog
dlog = Dynalog(…)
import pylinac
dlog = pylinac.Dynalog(…)
`
Fortunately, beginning in scientific Python is much easier than it was just a few years ago (no C compiler for numpy/scipy! Right? Anyone?). Get a distro stack (anaconda’s is quite nice), a friendly IDE (Spyder if you come from Craplab, er I mean Matlab. I use PyCharm but it’s a bit intimidating at first), learn how to create envs, use python 3, and put stackoverflow on your bookmarks.
Oh and I forgot jupyter! How could I forget? Good for interactive work and well-adopted by the scientific community. It has limitations but you probably won’t run into them for a while.