Skip to content

Commit 2748a39

Browse files
authored
Updates 12-24 (#27)
* update section 1 and main section * update links section 2 and 3 * update link 4 * update link 5
1 parent 056b013 commit 2748a39

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

Material_Part1_PEP/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ You can find a list of PEPs [here](https://peps.python.org/).
1414

1515
1. Line length
1616
Don't write lines that are very long. Reason: Often you would use multiple windows next to each other and that makes it hard to read code (and possibly lead to introduction of bugs).
17-
PEP 8 recommends lines no longer than 79 characters, but 90 is also a good number.
17+
PEP 8 recommends lines no longer than 79 characters, but 90 is also used quite often.
1818

1919
1. Alignment of code
2020
Make use of indentation when using continuation lines:
@@ -128,11 +128,11 @@ Make use of indentation when using continuation lines:
128128
- use two leading underscores to invoke name mangling for attributes that should not be used in subclasses of the parent class (`__only_parent`)
129129
- double leading and trailing underscores for "magic" objects (dunder methods) - `__init__`, `__str__`
130130

131-
**Task 1: [GitHub assignment PEP right or wrong?](https://classroom.github.com/a/OQSBs2Ey)**
131+
**Task 1a: [GitHub assignment PEP right or wrong?](https://classroom.github.com/a/Vg9Rjdry)**
132132

133133
Please checkout the assignment repo and mark the answers in the file `chapter1/PEP_right_or_wrong.md` using markdown. Commit your answer to a new branch and open a pull request. If the autograding/CI checks succeed, you have marked the correct answers and can merge the pull request with main to submit your assignment.
134134

135-
**Task 2: [GitHub assignment PEP fixme's](https://classroom.github.com/a/gH7zaDzE)**
135+
**Task 1b: [GitHub assignment PEP fixme's](https://classroom.github.com/a/zEgcY5ds)**
136136

137137
Please checkout the assignment repo and correct the files `chapter1/example1.py`, `chapter1/example2.py` and `chapter3/example1.py` for stylistic and other errors that contradict PEP 8 recommendations. Commit your changes to a new branch and open a pull request. If the autograding/CI checks succeed, you have resolved all issues and can merge the pull request with main to submit your assignment.
138138

Material_Part2_Linter/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Linter
22
A code linter is there to highlight issues with the code that do not conform with a style guide, and that may lead to errors when interpreted or compiled. For Python, a code linter makes sure that the code conforms with PEP 8 standards.
33

4-
**Task 3: [GitHub assignment code linter and formatter](https://classroom.github.com/a/8Naj1QMJ)**
4+
**Task 2: [GitHub assignment code linter](https://classroom.github.com/a/d0dI5zx_)**
55

66
Please checkout the assignment repo and follow through with the commands below. Commit any changes to a new branch and open a pull request. If the autograding/CI checks succeed, you have completed all tasks and can merge the pull request with main to submit your assignment.
77

@@ -12,7 +12,7 @@ First, you need to install flake8. You can do so by typing
1212
```
1313
pip install flake8
1414
```
15-
in your terminal. Alternatively, you can install it via the `requirements.txt` in the assignment repo"
15+
in your terminal. Alternatively, you can install it via the `requirements.txt` in the assignment repo
1616
```
1717
pip install -r requirements.txt
1818
```

Material_Part3_Formatter/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ flake8 chapter2_3/example1.py
1818
```
1919
You will notice that flake8 is not returning errors except a line length error for one of the comment lines: Note that black does not reformat comments other than inserting proper whitespace before and after the #.
2020

21-
**Subtask (iii): Reformat `example1.py` and `example2.py` using black. Compare to your own reformatted files from the previous assignemt.**
21+
**Task 3: [GitHub assignment code formatter](https://classroom.github.com/a/nsZ7ryTk)**
22+
23+
**Subtask (i): Reformat `example1.py` and `example2.py` using black. Compare to your own reformatted files from the previous assignemt.**
2224

2325
## Black configuration
2426
Sometimes you only want to check what black would actually reformat. In order to do so, run
@@ -29,12 +31,12 @@ or
2931
```
3032
black chapter2_3/example1.py --diff --color
3133
```
32-
**Task 3: Now you should have completed all edits on your assignment repo and should be able to submit the results (if the autograding and CI do not raise any issues).**
34+
**Now you should have completed all edits on your assignment repo and should be able to submit the results (if the autograding and CI do not raise any issues).**
3335

3436
## Black with jupyter notebooks
3537
The new versions of black directly allow you to run it on jupyter notebooks,
3638

37-
**Subtask (iv): Try out reformatting notebooks with `example_jupyter.ipynb`.**
39+
**Subtask (ii): Try out reformatting notebooks with `example_jupyter.ipynb`.**
3840

3941

4042
## Black with VSCode

Material_Part4_Pitfalls/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pitfalls: Common ways to introduce bugs in your Python code
22

3-
**Task 4: [GitHub assignment Python pitfalls](https://classroom.github.com/a/N7Scip_G)**
3+
**Task 4: [GitHub assignment Python pitfalls](https://classroom.github.com/a/XBSxiwZi)**
44

55
Please checkout the assignment repo and follow through with the examples and instructions below. Commit any changes to a new branch and open a pull request. If the autograding/CI checks succeed, you have completed all tasks and can merge the pull request with main to submit your assignment.
66

Material_Part5_BetterCoding/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Better coding
22

3-
**Task 5: [GitHub assignment write more readable code using these suggestions](https://classroom.github.com/a/jQ5QZphi)**
3+
**Task 5: [GitHub assignment write more readable code using these suggestions](https://classroom.github.com/a/98DEpTgF)**
44

55
Please checkout the assignment repo and follow through with the examples and instructions below. Commit any changes to a new branch and open a pull request. If the autograding/CI checks succeed, you have completed all tasks and can merge the pull request with main to submit your assignment.
66

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# Python-best-practices-course
55
Material for the course "Python best practices", Scientific Software Center, Heidelberg University
66

7-
Inga Ulusoy, June 2024
7+
Inga Ulusoy, December 2024
88

9-
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.
9+
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 through implementing your own scripts, modules and packages. We will discuss some fundamental 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.
1010

1111
## Prerequisites
1212
Basic Python knowledge is required. Participants need a laptop/PC with a working Python environment installed, ideally in an IDE, and a GitHub account as we are using GitHub classrooms.
@@ -21,7 +21,7 @@ After the course participants will be able to
2121
## Time and place
2222
The course takes place in the conference room of the Mathematikon Bauteil A (room 5/104).
2323

24-
Course date: June 4th 2024, 9:00AM - 1:00PM
24+
Course date: December 16th 2024, 9:00AM - 1:00PM
2525

2626
## Course content
2727

@@ -33,4 +33,4 @@ Course date: June 4th 2024, 9:00AM - 1:00PM
3333

3434
## Additional Topics
3535

36-
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](https://www.ssc.uni-heidelberg.de/en/learning/all-courses) that you can participate in. There is also a [block course](https://ssciwr.github.io/sustainable_development_course/) that touches on all these aspects; the block course takes place every year in February/March.
36+
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 present Python-specific content. The SSC offers [tailored courses](https://www.ssc.uni-heidelberg.de/en/learning/all-courses) that you can participate in. There is also a [block course](https://ssciwr.github.io/sustainable_development_course/) that touches on all these aspects; the block course takes place every year in February/March.

0 commit comments

Comments
 (0)