From d00ae5a84254c22c0e06b8f6bc07fb6e0f12d35c Mon Sep 17 00:00:00 2001 From: "Ashwin V. Mohanan" Date: Tue, 23 Dec 2025 00:31:54 +0100 Subject: [PATCH 1/5] coderefinery-2025-september: day 9 modular & outro --- coderefinery-2025-september/editlist.yaml | 88 +++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/coderefinery-2025-september/editlist.yaml b/coderefinery-2025-september/editlist.yaml index a32c50d..97e44e6 100644 --- a/coderefinery-2025-september/editlist.yaml +++ b/coderefinery-2025-september/editlist.yaml @@ -498,6 +498,94 @@ - stop: 02:38:54 +# Day 9 +- input: raw/day9-obs.mkv +- schedule-sync: 00:11:34=11:00:00 + +- output: out/day9-intro.mkv + title: 9.1 Day 9 intro and icebreaker + description: > + Introduction to the final day of CodeRefinery covering modular code + development. Includes recap of day 8 (automated testing), icebreaker + about programming languages, and overview of the day's structure. + time: + - start: 00:11:34 + - -: Welcome and audio check + - 00:13:44: Recap of previous session (automated testing) + - 00:15:56: Icebreaker - programming languages discussion + - stop: 00:20:09 + +- output: out/day9-modular-code-development.mkv + title: 9.2 Modular Code Development + description: > + In this live-coding demo session we take a Python script as + starting point which reads data, computes simple statistics, and + generates a plot. Together we then improve this code based on + suggestions from the audience to arrive at a more reusable code + with reusable components. We start in the Jupyter notebook, later + move to a Python script/module, introduce testing, and finally + introduce and motivate a command line interface to our code. + + In this demonstration we use JupyterLab, Python, Pandas, + Matplotlib, pytest, and Click. It is also a great demonstration + of pair programming. + + Topics covered - functions vs. comments, eliminating code duplication, + Jupyter notebooks to Python scripts/modules, command-line interfaces, + testing integration, version control workflow, and pair programming + demonstration. + + https://coderefinery.github.io/modular-type-along/ + time: + - start: 00:20:09 + - -: Introduction to modular code development + - 00:21:36: Example of non-modularized code ("curse of bad code design") + - 00:24:32: Overview of lesson structure (demo, exercise, live coding) + - 00:25:19: §Starting with an example code in a Notebook + - 00:28:38: Demo - Initial Jupyter notebook setup and walkthrough + - 00:39:23: Exercise introduction (discussion track + coding track) + - exercise: 00:41:50 + - start: 01:01:00 + - -: Post-exercise discussion of modular code concepts + - break: 01:11:55 + - start: 01:22:15 + - -: Live coding session begins: one possible solution + - 01:23:04: Addressing suggestions from coding track - replace comments with functions, remove redundant comments + - 01:23:45: Plotting also February and March data + - 01:30:12: Abstracting the plotting part into a function + - 01:41:20: Testing refactored code and need for Jupyter kernel restart + - 01:43:54: Small improvements: adding a function for the statistics + - 01:49:10: Towards functions without side-effects: adding a main() function + - 01:50:26: Further modularization - move from notebooks to scripts + - 01:54:08: Static code checking in IDEs + - 01:55:39: Further modularization - move from notebooks to scripts (continued) + - break: 02:18:13 + - start: 02:27:32 + - -: Post-break reflection on modular code development + - 02:28:22: Revisiting exercise and questions from discussion track + - 02:34:12: Questions from notes + - stop: 02:41:01 + + +- output: out/day9-outro.mkv + title: 9.3 Concluding remarks + description: > + The concluding remarks of the workshop. + + Outro presentation (will be updated in the future): + https://github.com/coderefinery/workshop-outro/blob/master/README.md + time: + - start: 02:41:02 + - -: Workshop wrap-up and thank yous + - 02:42:04: Acknowledging participants, team leaders, instructors, collaborative document answerers, and local partners + - 02:42:54: Feedback + - 02:45:14: Certificates + - 02:45:28: Support CodeRefinery and get-involved + - 02:46:35: Research Software Development and Nordic-RSE + - 02:48:48: Final thank you and goodbye + - stop: 02:49:13 + + #- input: raw/day6-obs.mkv #- schedule-sync: 00:44=8:43:00 From 6610ecace0c4d4435be028c707020e543fca4be7 Mon Sep 17 00:00:00 2001 From: "Ashwin V. Mohanan" Date: Tue, 23 Dec 2025 00:43:19 +0100 Subject: [PATCH 2/5] coderefinery-2025-september: day 9 srt, fix nouns --- coderefinery-2025-september/raw/day9-obs.srt | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/coderefinery-2025-september/raw/day9-obs.srt b/coderefinery-2025-september/raw/day9-obs.srt index b2b210b..1b77c5b 100644 --- a/coderefinery-2025-september/raw/day9-obs.srt +++ b/coderefinery-2025-september/raw/day9-obs.srt @@ -20,7 +20,7 @@ I don't think you've seen me here before. 6 00:11:53,770 --> 00:11:55,472 -I've been around Code Refinery +I've been around CodeRefinery 7 00:11:55,472 --> 00:11:59,178 @@ -96,7 +96,7 @@ of my favorite days of 25 00:12:41,559 --> 00:12:44,282 -Code Refinery, just because it's +CodeRefinery, just because it's 26 00:12:44,282 --> 00:12:47,125 @@ -832,7 +832,7 @@ Yeah, so welcome everyone to 209 00:20:12,839 --> 00:20:15,144 -the last day of Code Refinery. +the last day of CodeRefinery. 210 00:20:15,144 --> 00:20:19,014 @@ -1664,7 +1664,7 @@ So first, I need to 417 00:29:24,715 --> 00:29:26,678 -activate the code refinery environment. +activate the CodeRefinery environment. 418 00:29:28,040 --> 00:29:29,883 @@ -1692,7 +1692,7 @@ what i know conda come 424 00:29:51,076 --> 00:29:53,179 -to activate code refinery this +to activate CodeRefinery this 425 00:29:53,179 --> 00:29:54,621 @@ -1732,7 +1732,7 @@ can do some other way. 434 00:30:23,814 --> 00:30:25,256 -Like if you were using VS code +Like if you were using VS Code 435 00:30:25,256 --> 00:30:26,758 @@ -3468,7 +3468,7 @@ i mean i guess that's basically 868 01:09:59,749 --> 01:10:01,352 -the reason why python is +the reason why Python is 869 01:10:01,352 --> 01:10:03,134 @@ -3476,7 +3476,7 @@ so popular it's definitely not 870 01:10:03,134 --> 01:10:05,057 -unique to python i mean natlab +unique to Python i mean MATLAB 871 01:10:05,057 --> 01:10:07,220 @@ -3492,7 +3492,7 @@ a bunch of code written in 874 01:10:10,585 --> 01:10:11,968 -c and fortran and then +c and Fortran and then 875 01:10:11,968 --> 01:10:13,950 @@ -5480,7 +5480,7 @@ to detect such kind of problems 1371 01:43:03,082 --> 01:43:08,569 -in python for example would some yeah +in Python for example would some yeah 1372 01:43:09,410 --> 01:43:11,313 @@ -9552,7 +9552,7 @@ code side of things that 2389 02:39:50,574 --> 02:39:52,497 -course isn't designed to teach python +course isn't designed to teach Python 2390 02:39:52,497 --> 02:39:54,279 @@ -9560,7 +9560,7 @@ but for people that have 2391 02:39:54,279 --> 02:39:59,426 -sort of used python before um it's +sort of used Python before um it's 2392 02:40:00,928 --> 02:40:05,254 From 26d0e16e7aeaac300254eaa039359c993e6f337f Mon Sep 17 00:00:00 2001 From: "Ashwin V. Mohanan" Date: Tue, 23 Dec 2025 00:43:46 +0100 Subject: [PATCH 3/5] coderefinery-2025-september: day 9 srt, fix filler words --- coderefinery-2025-september/raw/day9-obs.srt | 77 ++++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/coderefinery-2025-september/raw/day9-obs.srt b/coderefinery-2025-september/raw/day9-obs.srt index 1b77c5b..8b3fc38 100644 --- a/coderefinery-2025-september/raw/day9-obs.srt +++ b/coderefinery-2025-september/raw/day9-obs.srt @@ -872,7 +872,7 @@ but it really is like we 219 00:20:38,287 --> 00:20:42,712 -start um yeah we're starting +start yeah we're starting 220 00:20:42,712 --> 00:20:45,094 @@ -1672,7 +1672,7 @@ So I don't have the 419 00:29:29,883 --> 00:29:32,106 -conda activate by default. +Conda activate by default. 420 00:29:32,106 --> 00:29:35,271 @@ -1680,7 +1680,7 @@ So I run source, forge. 421 00:29:37,313 --> 00:29:40,498 -This is the magic word to activate a conda. +This is the magic word to activate a Conda. 422 00:29:41,643 --> 00:29:46,029 @@ -1688,7 +1688,7 @@ installation and then copying from 423 00:29:46,029 --> 00:29:51,076 -what i know conda come +what i know Conda come 424 00:29:51,076 --> 00:29:53,179 @@ -1708,7 +1708,7 @@ things to keep stuff organized using 428 00:29:59,547 --> 00:30:07,498 -use idea i will make their git uh +use idea i will make their git 429 00:30:11,697 --> 00:30:13,459 @@ -1848,7 +1848,7 @@ There's a copy button. 463 00:32:03,127 --> 00:32:09,454 -And let me rename it to, uh, +And let me rename it to,, 464 00:32:12,809 --> 00:32:14,912 @@ -1916,7 +1916,7 @@ and come here and go to the terminal here. 480 00:33:12,176 --> 00:33:15,880 -And if I type wgit and +And if I type wget and 481 00:33:15,880 --> 00:33:19,064 @@ -2088,7 +2088,7 @@ Yeah. 523 00:34:55,535 --> 00:35:02,661 -uh what can we do that yes +what can we do that yes 524 00:35:03,662 --> 00:35:05,444 @@ -2104,7 +2104,7 @@ at the solutions here and copying 527 00:35:10,088 --> 00:35:13,631 -from it um we can take suggestions later +from it we can take suggestions later 528 00:35:13,631 --> 00:35:17,174 @@ -2184,7 +2184,7 @@ Okay, good. 547 00:36:12,263 --> 00:36:14,486 -Okay, um, so yeah, around +Okay, so yeah, around 548 00:36:14,486 --> 00:36:17,670 @@ -2644,7 +2644,7 @@ we have 10 minutes to talk before 662 01:01:14,911 --> 01:01:18,295 -we go to a break so um +we go to a break so 663 01:01:20,978 --> 01:01:22,680 @@ -2764,7 +2764,7 @@ something like the computer networking 692 01:02:41,146 --> 01:02:42,768 -TCP IP, which, of course, +TCP/IP, which, of course, 693 01:02:42,768 --> 01:02:45,271 @@ -4724,11 +4724,11 @@ yes it's it it's not very clear 1182 01:34:10,311 --> 01:34:15,137 -so we needed to have uh we +so we needed to have we 1183 01:34:15,137 --> 01:34:17,881 -needed to know uh like uh +needed to know like 1184 01:34:17,881 --> 01:34:20,284 @@ -4736,7 +4736,7 @@ which months we want to plot or 1185 01:34:20,284 --> 01:34:23,148 -maybe not uh uh yeah should +maybe not yeah should 1186 01:34:23,148 --> 01:34:25,230 @@ -4744,7 +4744,7 @@ the month be captured inside 1187 01:34:25,230 --> 01:34:26,672 -of this function or outside uh +of this function or outside 1188 01:34:28,935 --> 01:34:31,938 @@ -5048,7 +5048,7 @@ we do have a mouse here that 1263 01:38:20,817 --> 01:38:26,503 -means we need to oh right uh yeah +means we need to oh right yeah 1264 01:38:26,503 --> 01:38:27,764 @@ -5452,7 +5452,7 @@ Better to pass it as a parameter. 1364 01:42:39,592 --> 01:42:44,578 -very great point yes uh okay +very great point yes okay 1365 01:42:44,578 --> 01:42:46,881 @@ -5460,7 +5460,7 @@ yes that's a very good point and 1366 01:42:46,881 --> 01:42:50,045 -we will see uh it's great +we will see it's great 1367 01:42:50,045 --> 01:42:53,490 @@ -5984,7 +5984,7 @@ three different oh it worked okay 1497 01:48:51,025 --> 01:48:57,642 -good um let's see how's our time doing um +good let's see how's our time doing 1498 01:48:57,642 --> 01:49:01,787 @@ -6388,7 +6388,7 @@ good point on the file name well it it works 1598 01:53:36,958 --> 01:53:38,580 -but uh yeah i guess it +but yeah i guess it 1599 01:53:38,580 --> 01:53:40,783 @@ -6396,11 +6396,11 @@ worked somehow it works you can 1600 01:53:40,783 --> 01:53:42,765 -still save the uh the files +still save the the files 1601 01:53:42,765 --> 01:53:45,448 -but uh it's definitely not a +but it's definitely not a 1602 01:53:45,448 --> 01:53:47,591 @@ -6792,7 +6792,7 @@ be, so it's the, it's a mass data and then 1699 01:58:08,982 --> 01:58:11,246 -uh actually we could hard +actually we could hard 1700 01:58:11,246 --> 01:58:15,654 @@ -7132,7 +7132,7 @@ don't need to touch anything of the code 1784 02:02:29,947 --> 02:02:32,591 -but we can flexibly uh +but we can flexibly 1785 02:02:32,591 --> 02:02:34,294 @@ -8124,7 +8124,7 @@ but you can also define 2032 02:14:24,610 --> 02:14:27,574 -uh what's it called argument and +what's it called argument and 2033 02:14:27,574 --> 02:14:28,635 @@ -8408,7 +8408,7 @@ i'm adding it to the notes 2103 02:17:37,169 --> 02:17:43,097 -break until uh eight minutes +break until eight minutes 2104 02:17:43,097 --> 02:17:45,820 @@ -8468,7 +8468,7 @@ There. 2118 02:27:33,794 --> 02:27:37,760 -So, um, yeah, we've got just +So, yeah, we've got just 2119 02:27:37,760 --> 02:27:39,362 @@ -9560,11 +9560,11 @@ but for people that have 2391 02:39:54,279 --> 02:39:59,426 -sort of used Python before um it's +sort of used Python before it's 2392 02:40:00,928 --> 02:40:05,254 -a um it's a good course +a it's a good course 2393 02:40:06,996 --> 02:40:09,239 @@ -9636,7 +9636,7 @@ that should i go to the outro 2410 02:40:51,750 --> 02:40:54,593 -of the day now uh yeah +of the day now yeah 2411 02:40:54,593 --> 02:40:56,555 @@ -10040,7 +10040,7 @@ or can you help me add unit 2511 02:44:46,854 --> 02:44:52,626 -testing to this um program i'm writing +testing to this program i'm writing 2512 02:44:52,626 --> 02:44:54,590 @@ -10088,7 +10088,7 @@ will tell you what we've got 2523 02:45:23,529 --> 02:45:25,392 -there um i don't remember the +there i don't remember the 2524 02:45:25,392 --> 02:45:27,816 @@ -10160,7 +10160,7 @@ you can follow us and boost 2541 02:46:03,626 --> 02:46:06,790 -us on different social media um +us on different social media 2542 02:46:08,032 --> 02:46:10,676 @@ -10188,7 +10188,7 @@ an exercise leader and help 2548 02:46:22,974 --> 02:46:26,980 -with the exercises then um +with the exercises then 2549 02:46:28,495 --> 02:46:29,536 @@ -10248,7 +10248,7 @@ term for that now. 2563 02:46:58,448 --> 02:47:00,451 -um called the research +called the research 2564 02:47:00,451 --> 02:47:02,515 @@ -10268,7 +10268,7 @@ who are in research but their 2568 02:47:08,104 --> 02:47:12,711 -skills lie in getting the um +skills lie in getting the 2569 02:47:13,873 --> 02:47:16,217 @@ -10280,7 +10280,7 @@ that working better and they're 2571 02:47:20,383 --> 02:47:23,308 -very important parts of the um +very important parts of the 2572 02:47:24,588 --> 02:47:25,770 @@ -10445,4 +10445,3 @@ Okay. 2612 02:49:11,885 --> 02:49:12,827 Bye bye. - From ff7ffa4a06526c6b1d6bc7153c789fc737f03aae Mon Sep 17 00:00:00 2001 From: "Ashwin V. Mohanan" Date: Tue, 23 Dec 2025 00:45:12 +0100 Subject: [PATCH 4/5] coderefinery-2025-september: day 9 srt, fix I --- coderefinery-2025-september/raw/day9-obs.srt | 40 ++++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/coderefinery-2025-september/raw/day9-obs.srt b/coderefinery-2025-september/raw/day9-obs.srt index 8b3fc38..035d4b5 100644 --- a/coderefinery-2025-september/raw/day9-obs.srt +++ b/coderefinery-2025-september/raw/day9-obs.srt @@ -1688,7 +1688,7 @@ installation and then copying from 423 00:29:46,029 --> 00:29:51,076 -what i know Conda come +what I know Conda come 424 00:29:51,076 --> 00:29:53,179 @@ -1708,7 +1708,7 @@ things to keep stuff organized using 428 00:29:59,547 --> 00:30:07,498 -use idea i will make their git +use idea I will make their git 429 00:30:11,697 --> 00:30:13,459 @@ -2132,11 +2132,11 @@ but okay so we need to add a mean value 534 00:35:32,502 --> 00:35:36,831 -so i guess it would go +so I guess it would go 535 00:35:36,831 --> 00:35:39,737 -around here actually i should +around here actually I should 536 00:35:39,737 --> 00:35:41,019 @@ -2144,7 +2144,7 @@ make the font size larger 537 00:35:41,019 --> 00:35:43,885 -shouldn't i why haven't people said that +shouldn't I why haven't people said that 538 00:35:45,198 --> 00:35:47,441 @@ -2628,7 +2628,7 @@ Bye. 658 01:01:02,176 --> 01:01:08,483 -hello we're back i think yes okay +hello we're back I think yes okay 659 01:01:08,483 --> 01:01:10,065 @@ -3464,7 +3464,7 @@ of glues together that code and 867 01:09:56,865 --> 01:09:59,749 -i mean i guess that's basically +I mean, I guess, that's basically 868 01:09:59,749 --> 01:10:01,352 @@ -3476,7 +3476,7 @@ so popular it's definitely not 870 01:10:03,134 --> 01:10:05,057 -unique to Python i mean MATLAB +unique to Python I mean MATLAB 871 01:10:05,057 --> 01:10:07,220 @@ -6388,7 +6388,7 @@ good point on the file name well it it works 1598 01:53:36,958 --> 01:53:38,580 -but yeah i guess it +but yeah I guess it 1599 01:53:38,580 --> 01:53:40,783 @@ -6804,7 +6804,7 @@ if this is the main thing we 1702 01:58:17,398 --> 01:58:26,975 -do i guess it's yeah because +do I guess it's yeah because 1703 01:58:26,975 --> 01:58:32,205 @@ -7120,7 +7120,7 @@ then give it the file name to 1781 02:02:18,056 --> 02:02:24,625 -save it and then it will save it there i guess +save it and then it will save it there I guess 1782 02:02:25,499 --> 02:02:27,903 @@ -8148,7 +8148,7 @@ on what i'm doing yes so 2038 02:14:46,537 --> 02:14:50,161 -output directory can i use +output directory can I use 2039 02:14:50,161 --> 02:14:51,563 @@ -8708,7 +8708,7 @@ done before i've done this big analysis 2178 02:30:34,580 --> 02:30:37,163 -or something and i know +or something and I know 2179 02:30:37,163 --> 02:30:39,345 @@ -8724,7 +8724,7 @@ and then in the future in all 2182 02:30:42,988 --> 02:30:44,469 -my projects i can run the +my projects I can run the 2183 02:30:44,469 --> 02:30:47,900 @@ -9568,7 +9568,7 @@ a it's a good course 2393 02:40:06,996 --> 02:40:09,239 -debuggers tdd i think means +debuggers tdd I think means 2394 02:40:09,239 --> 02:40:11,086 @@ -9632,7 +9632,7 @@ it improves reliability and all 2409 02:40:45,883 --> 02:40:51,750 -that should i go to the outro +that should I go to the outro 2410 02:40:51,750 --> 02:40:54,593 @@ -9652,7 +9652,7 @@ us we can't do stuff so to 2414 02:41:03,502 --> 02:41:06,085 -go to the outro i will click +go to the outro I will click 2415 02:41:07,043 --> 02:41:08,826 @@ -9672,7 +9672,7 @@ that in a tab fix the font 2419 02:41:19,043 --> 02:41:25,393 -size so i have the privilege +size so I have the privilege 2420 02:41:25,393 --> 02:41:29,048 @@ -10088,11 +10088,11 @@ will tell you what we've got 2523 02:45:23,529 --> 02:45:25,392 -there i don't remember the +there I don't remember the 2524 02:45:25,392 --> 02:45:27,816 -details but i think you've discussed it before +details but I think you've discussed it before 2525 02:45:30,732 --> 02:45:33,134 From 856b4e1b168d5cd5f986cb79a150d9e0426e6c9b Mon Sep 17 00:00:00 2001 From: "Ashwin V. Mohanan" Date: Tue, 23 Dec 2025 01:01:43 +0100 Subject: [PATCH 5/5] coderefinery-2025-september: day 9 srt, fix some commands --- coderefinery-2025-september/raw/day9-obs.srt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/coderefinery-2025-september/raw/day9-obs.srt b/coderefinery-2025-september/raw/day9-obs.srt index 035d4b5..4227a05 100644 --- a/coderefinery-2025-september/raw/day9-obs.srt +++ b/coderefinery-2025-september/raw/day9-obs.srt @@ -1688,11 +1688,11 @@ installation and then copying from 423 00:29:46,029 --> 00:29:51,076 -what I know Conda come +what I know, Conda ... 424 00:29:51,076 --> 00:29:53,179 -to activate CodeRefinery this +"conda activate coderefinery", this 425 00:29:53,179 --> 00:29:54,621 @@ -1708,11 +1708,11 @@ things to keep stuff organized using 428 00:29:59,547 --> 00:30:07,498 -use idea I will make their git +use idea I will "mkdir git/..." 429 00:30:11,697 --> 00:30:13,459 -modular exercise 2025 to +"mkdir git/modular-exercise-2025" to 430 00:30:14,501 --> 00:30:15,562 @@ -1780,7 +1780,7 @@ I don't want it to start somewhere random. 446 00:30:52,990 --> 00:30:55,752 -So I type JupyterLab, no browser. +So I type "jupyter lab --no-browser". 447 00:30:55,752 --> 00:31:05,741 @@ -2240,7 +2240,7 @@ that there's in matplotlib, there's 561 00:37:08,924 --> 00:37:11,247 -this ax h line function. +this "axhline" function. 562 00:37:13,268 --> 00:37:15,231