DAY 1

2 get everything ready

  • Create a repo on GitHub

  • Create and connect a GitHub Project

  • add a first issue

  • conda create -p .\.env

  • conda install pip python=3.10

  • link to db: https://verkehr.autobahn.de/o/autobahn

  • pip install jupyter requests pandas

  • conda 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

3 Social Coding

  • pyscaffold:

    • pip install -U pyscaffold

    • putup *my_project_name*

    • remove template files

    • connect with your new repo: git clone *https://github.com/user/repo.git*

    • pip install tox

    • remove 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

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

  • Clean Code principles by Uncle Bob Robert C. Martin

  • Style guides and best practices:

  • 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 tox

  • local wheels: tox -e build

  • new release -> action: pypi-deploy.yml

  • streamlit: use always Co-Pilot 😀😀