The schedule below was followed during a Software Carpentries Workshop, hosted at the TU Delft in November 2021
[https://swcarpentry.github.io/python-novice-inflammation/]
12:15 - Organizers/instructors/helpers in the Zoom meeting room to check last set ups, introductions etc
12:30 - Welcome and instructions of the day
- Reminder Code of Conduct/How to get help
- Reminder on how to get help
- Programme of the day
- Roll call & Ice breaker
12:40 - First 5 mins to check that everybody installed Anaconda and download the datasets
swc-python
folder on Desktop
$ conda --version
$ python --version
$ jupyter --version
12:45 - Introducing Jupyter (15 min)
-
Anaconda and Jupyter Lab/Notebooks 10 min - to download Anaconda
-
Slides on Jupyter Notebook features (10 min)
13:00 - Python Fundamentals (45 mins)
13:45 - BREAKOUT Session 1 (15 min) Exercises 1 and 2 (open in browser)
14:00 - Coffee break (15 min)
14:15 - Loading and analysing data in Python (30 mins)
- Lesson 2 (original 60 mins) Import and NumPy and display data (15 mins) Basic statistics on data (10 mins)
14:45 - Visualizing Data (45 mins)
- Lesson 3 (original 50 mins) Matplotlib (15 mins) Plotting (15 mins) Saving plots (10 min)
15:30 - Coffee break
15:45 - Repeating actions with FOR Loops (45 mins)
- Lesson 5 (original 30 mins)
- Lesson 6 (original 20 mins) Introducing For Loops_ Analyzing data from multiple files_
16:30 - BREAKOUT Session 2 (20 min) Exercises 3 and 4 (open in browser)
16:50 - Final questions for the day + reminder feedback
17:00 - End
17:00 - Sharing Feedback Instructors/Helpers
12:15 - Organizers/instructors/helpers in the Zoom meeting room to check last set ups, introductions etc
12:30 - Start workshop and let participants in! We should not need time to check installations as any remaining problems are addressed on day 3.
12:30 - Welcome and instructions of the day @ Paula
- Reminder Code of Conduct/How to get help.
- Programme of the day
- Ice breaker
12:40 - Recap of Day 2 (5 minutes)
12:45 - Making Choices (20 minutes teaching + 5 minutes exercise)
Plenary Exercises:
-
Plenum: How many paths?
-
Together, inspect all datasets for suspicious data
13:15 - Creating Functions (20 minutes teaching + 5 minutes plenum exercises)
- Lesson 8 Skipping: Testing and Documentation
Plenary Exercises:
13:35 - Breakout Session 1 (25 min) Exercise 7 (open in browser)
These exercises can also be found on the SWC website:
14:00: Coffee Break I
ADDED part on modular code
- Tidying-up
- Create script called
processing.py
- Copy functions (visualize, detect_problems) to script
- Create new notebook called
inflammation_analysis_refactored.ipynb
- Import (visualize, detect_problems) in the new notebook and place in for-loop to analyse for all files
- Questions in session:
a. Do we still need to import numpy and matplotlib when we are importing them in theprocessing.py
script?
No, this is handled in the script.
b. What happens to the savefig in the loop?
Currently, during each loop the fileimflammation.png
is overwritten. Solution for future sessions: We could add new savenames or leave the savefig out of the functions entirely for simplicity.
Resources on structuring python code:
- https://realpython.com/absolute-vs-relative-python-imports/
- http://cicero.xyz/v3/remark/0.14.0/github.com/coderefinery/modular-code-development/master/talk.md/#1
14:15: Errors and Exceptions (15 minutes teaching + 5 minutes exercise)
Example plenum:
- SKIPPED: Reading Error Messages
14:40: Defensive Programming (20 min)
- Lesson 10
- Example for a pre-condition to find empty array
- Add precondition to inflammation_analysis.ipynb
- Skipped: Replace previous conditional statements in
inflammation_analysis.ipynb
by assertions
Questions during session: a. When would you use assert and when a conditional statement? Assert is used to verify the correct usage and executation of your code. Conditional statements are used to handle choices as part of the code functionality.
15:05: SKIPPED DUE TO LACK OF TIME!
- Lesson 11 Debugging (20 minutes teaching + 5 minutes exercise)
Exercises:
- Plenum: Not Supposed to be the Same
15:30: Coffee Break II
15:45: Command-Line Programs (45 min)
- For instructors: Use a history terminal
- Lesson 12
16:30: Breakout Session 2 (30 min)
- Exercise 9, 10 and (optional) 11
Solutions are already present in the code folder (use code/reading_06.py as starting point):
Solution exercise 9:code/reading_08.py
Solution exercise 10:code/reading_09.py
Solution exercise 11:code/my_ls.py
16:50 - Wrap up, Questions, etc.
17:00 - End
17:00 - Sharing Feedback Instructors/Helpers