Skip to content

Material for the course "Python best practices", Scientific Software Center, Heidelberg University

License

Notifications You must be signed in to change notification settings

tmhist/Python-best-practices-course

 
 

Repository files navigation

Code style: black

Python-best-practices-course

Material for the course "Python best practices", Scientific Software Center, Heidelberg University

Inga Ulusoy, October 2022

Python has rapidly advanced to the most popular programming language in science and research. From data analysis to simulation and preparation of publications, all can be done in Python with appropriate libraries and implementing own modules. We will discuss most important Python Enhancement Proposals (PEP) and how these can help you write cleaner code. You will learn how to use a code linter and code formatter. Common pitfalls in Python will be explained with examples. We will demonstrate typical “bad programming” and how to code the examples in a more pythonic way.

Prerequisites

Basic Python knowledge is required. Participants need a laptop/PC with camera and microphone.

Learning objectives

After the course participants will be able to

  • Understand the basic PEP recommendations
  • Use a linter and code formatter to ensure following of the guidelines
  • Write better=more readable code
  • Avoid bugs through best practices for example in passing keyword arguments

Time and place

The course takes place online. A link will be sent to all registered participants.

Course date: Nov 8th 2022, 9:00AM - 1:00PM

Course content

  1. PEP recommendations
  2. Linting
  3. Code formatting
  4. Write better code: Pitfalls
  5. Write better code: Examples

Additional Topics

For general coding best practices, you should always put your source code under version control, implement tests and a documentation, and also add a license to your code. It is not possible to discuss all of this in a short course - here we only discuss Python-specific content. The SSC offers tailored courses that you can participate in. There is also a block course that touches on all these aspects; the block course takes place every year in early March.

About

Material for the course "Python best practices", Scientific Software Center, Heidelberg University

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Perl 68.9%
  • Python 20.4%
  • Terra 5.7%
  • Jupyter Notebook 5.0%