Skip to content

Commit

Permalink
Merge branch 'ht23' of github.com:NBISweden/workshop-python into ht23
Browse files Browse the repository at this point in the history
  • Loading branch information
ninanorgren committed Oct 10, 2023
2 parents 007387f + 5265976 commit d37cc93
Show file tree
Hide file tree
Showing 9 changed files with 2,201 additions and 21 deletions.
1 change: 1 addition & 0 deletions lesson_plans/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ day_3.html
day_3.ipynb
day_3.tex
day_3.pdf
temp_ruff_results.txt
58 changes: 56 additions & 2 deletions lesson_plans/20231110_richel.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
# Lesson plan 2023-11-10 by Richel

Current schedule:
## Learning objectives

* Ultimate: to express your ideas in correct and readable code
* Have used assert to check for correctness
* Have practiced with function names
* Experience that a class helps you keep an overview
* Work with set and dict
* Work with arguments

## Teacher goals

* Engage all students, including the Umea students
* Prepare in a short time span; adapt to materials instead of other way around

## Teacher needs

* [Asked] Umea needs a good mic
* [Asked] Zoom room needs subtitles
* [ ] Use a HackMD document
* Favorite Python function?
* Why use a set?

## Review questions

To ask after the quiz:

* How to determine if a variable is a tuple?
* How to prove that a tuple is immutable?
* How to prove that a list is mutable?
* How to prove that something is a function?
* How to prove that something is a method?

## Schedule

When |What
-----|----------------
9:00 |HackMD
9:10 |Review questions
9:30 |assert
9:40 |Deeper review questions
10:00|Fika
10:15|set
11:00|Break
11:15|dict
12:00|Lunch
13:00|Functions
14:00|Break
14:15|sys.args
15:00|Fika
15:15|Project
16:00|Break
16:15|Project
17:00|Done

## Old schedule

Time |Title |Form
-----|----------------|----------------
Expand All @@ -20,4 +74,4 @@ Time |Title |Form
14:30|IMDb prettyprint|
15:00|PyQuiz |Ls do quizzes
15:20|project |
17:00|End |.
17:00|End |.
20 changes: 20 additions & 0 deletions lesson_plans/check_python_style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
#
#

# Ignore the first ruff error
ruff day_3.qmd > temp_ruff_results.txt 2>&1

last_line=$(cat temp_ruff_results.txt | tail -n 1)
# echo "last_line: ${last_line}"
n_errors_plus_one=$(echo "${last_line}" | cut -d ' ' -f 2)
# echo "Number of errors plus one: ${n_errors_plus_one}"
n_errors=$((n_errors_plus_one-1))
echo "Number of errors: ${n_errors}"

exit ${n_errors}

# FAILS: will still always give an error
# Remove the part between '---'
#tail -n +11 day_3.qmd > temp_day_3.qmd
#ruff temp_day_3.qmd
Loading

0 comments on commit d37cc93

Please sign in to comment.