Structure of a script
- Initially you should specify which packages you use in the scripts
- Next your code for the specific problem that you are trying to solve, all written code should be containded in a function/classes
It should contain a main function with is calling all individual function to solve the problem.
- If the script is a standalone script, it can be run by calling python myscript.py it should contain...
Tips and tricks
- Plotting scripts should be named the same as the output figure for easier backtracking
- Plotting scripts should start with plot, so that one can create a bash script for that executes all plot* scripts
- If you use a directory for managing specific task, in python it is called a module, you neeed a init.py file in the directory more in packagehowto
Naming conventions
- Use snake_case for functions and variables
Documentation
- Use docstrings for all functions and classes