DAY 1
2 get everything ready
Create a repo on GitHub
Create and connect a GitHub Project
add a first issue
conda create -p .\.envconda install pip python=3.10
link to db: https://verkehr.autobahn.de/o/autobahn
pip install jupyter requests pandasconda list, conda info -e,
https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf
GitHUb extensions: Python, jupyter, GitHub Copilot, Black formatter, flake8, IntelliCode, pylance (all from Microsoft), (GitLens)
Jupyter vs pure python
terminal, variables, plots
autocomplete, help, f12, f2
4 Writing Your First Code Example
Find to two other user
create a common project (e.g. diving hours from Flensburg to Kassel on A7, driver model, traffic information, with or w/o breaks, construction information)
define branch strategy
add different issues
add new features, functions, plots, …
add new database, classes
try out Social Coding, work together with reviewing, pair programming and so on
DAY 2
1 Test Driven Development
gps data with NaN
local test
test pyramid: https://martinfowler.com/articles/practical-test-pyramid.html
pytest, coverage: https://coverage.readthedocs.io/en/latest/index.html, actions
define a new test, which tests a new functionality (refactor it manually), let GitHub write the corresponding function
define an action that makes 100% coverage mandatory
show the coverage report on GitHUb pages
define a driver model based on TDD
2 Documentation
readme.md
docstrings
sphinx local: https://www.sphinx-doc.org/en/master/usage/quickstart.html#setting-up-the-documentation-sources
add notebook as Getting Started, nbsphinx and pandoc: https://github.com/jgm/pandoc/releases/tag/3.5
change html theme
github pages: use action from torchphyics, change requirements.txt in doc
(GitHub wiki)
3 Clean Coding
Style guides and best practices:
PEP 8 for Python
Naming conventions, code layout, and formatting
Refactoring techniques:
Extract method
Simplify conditional expressions
Remove code duplication
Code reviews and pair programming
Tools for enforcing clean code:
linters (flake8, pylint)
formatters (Black)
static code analysis (mypy)
Writing meaningful comments and documentation
Code metrics and quality gates
4 Deployment
pip install toxlocal wheels:
tox -e buildnew release -> action: pypi-deploy.yml
streamlit: use always Co-Pilot 😀😀
3 Social Coding
pyscaffold:
pip install -U pyscaffoldputup *my_project_name*remove template files
connect with your new repo:
git clone *https://github.com/user/repo.git*pip install toxremove requirements.txt
configure your setup.cfg
pip install -e .[testing]commit-hooks: https://pre-commit.com/
insert a function and try out your first commit
calculate_traffic_length
map_plot of traffic
add issues add branches -> pull request, assign users, set milestones