View on GitHub

sustainable_development_course

Course material for "Scientific Software Development"

Unit 2: Clean coding as a team: Adhere to guidelines and common coding principles

In unit 2, you will practice collaborative software development using git, GitHub and an IDE (Integrated Development Environment), and learn about clean coding and best principles.

If you run into problems at any point, please contact us via inga.ulusoy@uni-heidelberg.de or open an issue on github.

The slides for this session are found here. The demonstrations are listed here and the necessary commands for the live lession are summarized here.

1. Unit 2, Part 1

We will to learn about technical debt, coding best practices and Python style guides.

2. Style Guides

Go to the PEP-8 style guide and read through these sections: Code Layout, Naming Conventions. You may read more or also peruse the google recommendations.

The recommendations for naming, especially naming of modules, is very important if you want to publish your package in the Python Package Index PyPI.

3. Working with an IDE

Download and install Visual Studio Code or another IDE of your choice. Work through this page about VSCode with Python.

4. Work with a linter

Run the linter on your jupyter notebook and correct any issues. Install the linter as pre-commit hook.

5. Clean repositories

Look at your .gitignore file and see if there are any more files that should be excluded from version tracking.

6. Work in your team

You will form teams and agree on which team member solves which task. Create one repository on GitHub for the team and merge your changes into one notebook. Continue working on your Notebooks. Collaborate through GitHub, and use branches, pull request, and request reviews from your team members before merging any branches into main.