|
1 | 1 | {
|
2 | 2 | "cells": [
|
3 | 3 | {
|
4 |
| - "cell_type": "code", |
5 |
| - "execution_count": null, |
| 4 | + "cell_type": "raw", |
6 | 5 | "metadata": {},
|
7 |
| - "outputs": [], |
8 | 6 | "source": [
|
9 |
| - "%%javascript\n", |
10 |
| - "IPython.OutputArea.prototype._should_scroll = function(lines) {\n", |
11 |
| - " return false;\n", |
12 |
| - "}" |
| 7 | + "---\n", |
| 8 | + "title: \"Python Tutorial 2023\"\n", |
| 9 | + "subtitle: \"17-20 April\"\n", |
| 10 | + "format: revealjs\n", |
| 11 | + "callout-icon: false\n", |
| 12 | + "jupyter: python3\n", |
| 13 | + "highlight-style: gruvbox\n", |
| 14 | + "execute:\n", |
| 15 | + " echo: true\n", |
| 16 | + " enabled: false\n", |
| 17 | + "---" |
13 | 18 | ]
|
14 | 19 | },
|
15 | 20 | {
|
16 |
| - "cell_type": "code", |
17 |
| - "execution_count": null, |
| 21 | + "cell_type": "markdown", |
18 | 22 | "metadata": {},
|
19 |
| - "outputs": [], |
20 | 23 | "source": [
|
21 |
| - "import matplotlib.pyplot as plt\n", |
22 |
| - "import numpy as np\n", |
23 |
| - "%matplotlib inline" |
| 24 | + "## Welcome! 🐍\n", |
| 25 | + "\n", |
| 26 | + "Hello and welcome, everyone! We’re excited that you chose to embark in this Python journey\n", |
| 27 | + "\n", |
| 28 | + "Over **four** days, we'll see a lot of Python. **Two** fundamental topics each day\n", |
| 29 | + "\n", |
| 30 | + "::: {.panel-tabset}\n", |
| 31 | + "\n", |
| 32 | + "### Day 1\n", |
| 33 | + "1. Basic syntax and data ty
8000
pes\n", |
| 34 | + "2. Control flow, loops, and exceptions\n", |
| 35 | + "\n", |
| 36 | + "### Day 2\n", |
| 37 | + "1. Functions\n", |
| 38 | + "2. Working with files\n", |
| 39 | + "\n", |
| 40 | + "### Day 3\n", |
| 41 | + "1. Functional programming\n", |
| 42 | + "2. Object-oriented programming\n", |
| 43 | + "\n", |
| 44 | + "### Day 4\n", |
| 45 | + "1. Modules and packages\n", |
| 46 | + "2. Questions, exercises, more questions...\n", |
| 47 | + "\n", |
| 48 | + ":::\n", |
| 49 | + "\n", |
| 50 | + "\n", |
| 51 | + "::: {.notes}\n", |
| 52 | + "\n", |
| 53 | + "Although this is an introductory course, we will be going quite in-depth to cover as much ground as possible. Our aim is to equip you with a strong foundation in Python programming that you can build on in the future. So, let's get started!\n", |
| 54 | + "\n", |
| 55 | + ":::" |
24 | 56 | ]
|
25 | 57 | },
|
26 | 58 | {
|
27 |
| - "cell_type": "code", |
28 |
| - "execution_count": null, |
| 59 | + "cell_type": "markdown", |
29 | 60 | "metadata": {},
|
30 |
| - "outputs": [], |
31 | 61 | "source": [
|
32 |
| - "plt.scatter(np.random.randn(1000),\n", |
33 |
| - " np.random.randn(1000),\n", |
34 |
| - " c=np.random.randn(1000), s=100)" |
| 62 | + "## Timetable\n", |
| 63 | + "\n", |
| 64 | + "**TL;DR:** Every morning, 9:00-13:00, on Zoom\n", |
| 65 | + "\n", |
| 66 | + ". . .\n", |
| 67 | + "\n", |
| 68 | + "More in detail:\n", |
| 69 | + "\n", |
| 70 | + "::: {.incremental}\n", |
| 71 | + "\n", |
| 72 | + "- 8:45-9:00 — Welcome, warm-up questions\n", |
| 73 | + "- 9:00-10:50 — Topic 1 (theory, hands-on, Q&A)\n", |
| 74 | + "- *10:50-11:10 — Break ☕*\n", |
| 75 | + "- 11:10-13:00 — Topic 2\n", |
| 76 | + "\n", |
| 77 | + ":::" |
35 | 78 | ]
|
36 | 79 | },
|
37 | 80 | {
|
38 |
| - "cell_type": "code", |
39 |
| - "execution_count": null, |
| 81 | + "cell_type": "markdown", |
40 | 82 | "metadata": {},
|
41 |
| - "outputs": [], |
42 | 83 | "source": [
|
43 |
| - "from tutorial.common import Question, Quiz" |
| 84 | + "## How to interact\n", |
| 85 | + "\n", |
| 86 | + "::: {.notes}\n", |
| 87 | + "\n", |
| 88 | + "Each block is 20% theory and 80% hands-on. It's an online workshop, so interaction between us is **essential**\n", |
| 89 | + "\n", |
| 90 | + ":::\n", |
| 91 | + "\n", |
| 92 | + "A few tips to interact:\n", |
| 93 | + "\n", |
| 94 | + "::: {.panel-tabset}\n", |
| 95 | + "\n", |
| 96 | + "### On Zoom\n", |
| 97 | + "- Raise your hand 🤚 then ask\n", |
| 98 | + "- Write in the chat\n", |
| 99 | + "- We will open a break-out room to address longer questions. **Anyone** interested can jump in\n", |
| 100 | + "\n", |
| 101 | + "\n", |
| 102 | + "### On Slack\n", |
| 103 | + "- Ask your question in the **corresponding channel**. Use `#help` for generic questions\n", |
| 104 | + "- Reply **in a thread** if you want to add a comment on another question\n", |
| 105 | + "- Use `@Sasha`, `@Simone`, `@Edoardo` if you want to mention the tutorial instructors directly\n", |
| 106 | + "\n", |
| 107 | + ":::\n", |
| 108 | + "\n", |
| 109 | + "::: {.notes}\n", |
| 110 | + "\n", |
| 111 | + "Although the chat will be distributed together with the recording, Slack is much better suited to hold continued Q&A and other discussions. Please, use it.\n", |
| 112 | + "\n", |
| 113 | + ":::" |
44 | 114 | ]
|
45 | 115 | },
|
46 | 116 | {
|
47 |
| - "cell_type": "code", |
48 |
| - "execution_count": null, |
| 117 | + "cell_type": "markdown", |
49 | 118 | "metadata": {},
|
50 |
| - "outputs": [], |
51 | 119 | "source": [
|
52 |
| - "q1 = Question(\n", |
53 |
| - " question='What is the answer to life, the universe, and everything?',\n", |
54 |
| - " options={\n", |
55 |
| - " '42': 'The answer is 42! You are correct!',\n", |
56 |
| - " '41': 'A bit more',\n", |
57 |
| - " '44': 'A bit less',\n", |
58 |
| - " '45': 'A bit less',\n", |
59 |
| - " },\n", |
60 |
| - " hint=\"2**2 * 10 + 4\",\n", |
61 |
| - " correct_answer='42',\n", |
62 |
| - " shuffle=True,\n", |
63 |
| - " )\n", |
64 |
| - "\n", |
65 |
| - "q2 = Question(\n", |
66 |
| - " question=\"How many planets are there in our solar system?\",\n", |
67 |
| - " options={\n", |
68 |
| - " '8': 'The answer is 8. You are correct!',\n", |
69 |
| - " '9': 'You are close, but not quite there.',\n", |
70 |
| - " '10': 'A bit less.',\n", |
71 |
| - " },\n", |
72 |
| - " hint=\"pluto is not a planet anymore.\",\n", |
73 |
| - " correct_answer='8',\n", |
74 |
| - " shuffle=True,\n", |
75 |
| - " )\n", |
76 |
| - "\n", |
77 |
| - "quiz = Quiz(questions=[q1, q2])\n", |
| 120 | + "## How to use notebooks\n", |
78 | 121 | "\n",
|
| 122 | + "\n", |
| 123 | + "1. The link to open Binder is on Slack in `#announcements` and in Zoom's chat\n", |
| 124 | + "2. Open the `index.ipynb` file and click on the current topic link\n", |
| 125 | + "3. Run the code, modify, experiment\n", |
79 | 126 | "\n"
|
80 | 127 | ]
|
81 | 128 | },
|
82 | 129 | {
|
83 |
| - "cell_type": "code", |
84 |
| - "execution_count": null, |
| 130 | + "cell_type": "markdown", |
85 | 131 | "metadata": {
|
86 |
| - "scrolled": true |
| 132 | + "tags": [] |
87 | 133 | },
|
88 |
| - "outputs": [], |
89 | 134 | "source": [
|
90 |
| - "display(quiz)" |
| 135 | + "## Exercises 🌶️\n", |
| 136 | + "\n", |
| 137 | + "::: {.fragment}\n", |
| 138 | + "\n", |
| 139 | + "For each topic we prepared a bunch of exercises to practice the concepts\n", |
| 140 | + "\n", |
| 141 | + ":::\n", |
| 142 | + "\n", |
| 143 | + "::: {.fragment}\n", |
| 144 | + "\n", |
| 145 | + "You will see cells like\n", |
| 146 | + "\n", |
| 147 | + "```{.python code-line-numbers=\"false\"}\n", |
| 148 | + "%%ipytest\n", |
| 149 | + "\n", |
| 150 | + "def solution_to_exercise(input_arg):\n", |
| 151 | + " \"\"\"\n", |
| 152 | + " Write your solution here\n", |
| 153 | + " \"\"\"\n", |
| 154 | + " pass\n", |
| 155 | + "```\n", |
| 156 | + "\n", |
| 157 | + "**Unless otherwise noted**, you can delete everything *below* the line starting with `def` and write your solution\n", |
| 158 | + "\n", |
| 159 | + ":::\n", |
| 160 | + "\n", |
| 161 | + "::: {.notes}\n", |
| 162 | + "\n", |
| 163 | + "The \"chili\" 🌶️ symbol estimates the effort required. In general, more chilis mean more work and thinking to solve the exercise\n", |
| 164 | + "\n", |
| 165 | + "Double-check before deleting everything in a solution's cell. There might be useful hints to solve the exercise!\n", |
| 166 | + "\n", |
| 167 | + ":::" |
| 168 | + ] |
| 169 | + }, |
| 170 | + { |
| 171 | + "cell_type": "markdown", |
| 172 | + "metadata": {}, |
| 173 | + "source": [ |
| 174 | + "## Exercises 🌶️\n", |
| 175 | + "\n", |
| 176 | + "::: {.callout-important}\n", |
| 177 | + "\n", |
| 178 | + "If you tried to evaluate an exercise cell and you see the error\n", |
| 179 | + "\n", |
| 180 | + "```\n", |
| 181 | + "UsageError: Cell magic %%ipytest not found\n", |
| 182 | + "```\n", |
| 183 | + "\n", |
| 184 | + "make sure you **first** evaluate the cell with the content below\n", |
| 185 | + "\n", |
| 186 | + "```\n", |
| 187 | + "%reload_ext tutorial.tests.testsuite\n", |
| 188 | + "```\n", |
| 189 | + "\n", |
| 190 | + "You should find it just after the **Exercises** section heading\n", |
| 191 | + "\n", |
| 192 | + ":::\n", |
| 193 | + "\n", |
| 194 | + ". . .\n", |
| 195 | + "\n", |
| 196 | + "::: {.callout-tip}\n", |
| 197 | + "\n", |
| 198 | + "There might be more exercises than time available. Don't worry, you can come back and continue any time, even after the workshop\n", |
| 199 | + "\n", |
| 200 | + ":::\n", |
| 201 | + "\n", |
| 202 | + "::: {.notes}\n", |
| 203 | + "\n", |
| 204 | + "Remember: **ask** if you need help, either on Zoom or on Slack. These four days should be a practical workshop where we can answer to most of your questions you have as a beginner Python user. Let's make the most out of this time!\n", |
| 205 | + "\n", |
| 206 | + ":::" |
| 207 | + ] |
| 208 | + }, |
| 209 | + { |
| 210 | + "cell_type": "markdown", |
| 211 | + "metadata": {}, |
| 212 | + "source": [ |
| 213 | + "# Let's get started! 🐍" |
91 | 214 | ]
|
92 | 215 | }
|
93 | 216 | ],
|
94 | 217 | "metadata": {
|
95 | 218 | "kernelspec": {
|
96 |
| - "display_name": "Python 3", |
| 219 | + "display_name": "Python 3 (ipykernel)", |
97 | 220 | "language": "python",
|
98 | 221 | "name": "python3"
|
99 | 222 | },
|
|
107 | 230 | "name": "python",
|
108 | 231 | "nbconvert_exporter": "python",
|
109 | 232 | "pygments_lexer": "ipython3",
|
110 |
| - "version": "3.7.3" |
| 233 | + "version": "3.11.0" |
111 | 234 | },
|
112 | 235 | "vscode": {
|
113 | 236 | "interpreter": {
|
|
116 | 239 | }
|
117 | 240 | },
|
118 | 241 | "nbformat": 4,
|
119 |
| - "nbformat_minor": 2 |
| 242 | + "nbformat_minor": 4 |
120 | 243 | }
|
0 commit comments