[project] adding readmeas to code and data folder
This commit is contained in:
parent
f3ac791726
commit
c805605ecf
41
code/README.md
Normal file
41
code/README.md
Normal file
@ -0,0 +1,41 @@
|
||||
# Structure of a script
|
||||
|
||||
1. Initially you should specify which packages you use in the scripts
|
||||
|
||||
~~~python
|
||||
import pathlib # Packages that are provided from python
|
||||
|
||||
import numpy as np # Packages that are downloaded, specified in the requierements.txt
|
||||
|
||||
import myscript # Scripts from your Project/Pipeline
|
||||
~~~
|
||||
|
||||
|
||||
2. 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.
|
||||
|
||||
~~~python
|
||||
def load_data(path):
|
||||
with open(path, "r") as f:
|
||||
f.read()
|
||||
return f
|
||||
|
||||
def main(path):
|
||||
load_data(path)
|
||||
~~~
|
||||
|
||||
3. If the script is a standalone script, it can be run by calling python myscript.py it should contain...
|
||||
|
||||
~~~python
|
||||
if __name__ == "__main__":
|
||||
path = "../data/README.md"
|
||||
main(path)
|
||||
~~~
|
||||
|
||||
# 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](https://whale.am28.uni-tuebingen.de/git/pweygoldt/packagehowto)
|
||||
|
||||
|
||||
|
3
data/README.md
Normal file
3
data/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Tips and Tricks for the data directory
|
||||
|
||||
The filename should contain information about the date
|
Loading…
Reference in New Issue
Block a user