Skip to content

Commit

Permalink
Add error handling videos.
Browse files Browse the repository at this point in the history
  • Loading branch information
janosg committed Nov 14, 2023
1 parent ae3fb6c commit 30e795e
Show file tree
Hide file tree
Showing 202 changed files with 7,042 additions and 592 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/0cc420ff7ff8312cf025170258d15f74/plotting-tweak_px.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/3793951a17990cd6feb257c3fe80858f/projects-setup.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/5140db96ccdfb8ce7cbb85ed14c1d041/projects-paths.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/632263fe7c244d00de46295397df23b0/pandas-rules.pdf
Binary file not shown.
Binary file modified _downloads/6af7b7987d7b9db774a5e6a322d671a5/git-introduction.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/71ec56bb1ce9431f6f20f7422348253a/background-graphs.pdf
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/797a90c46f861a8856f79d051a71ab66/pandas-merging.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/83be5425c95a0fd95b0bf3cc42d1e254/git-pre_commits.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/cb575c6779071de1750436c36c0f21ab/pandas-selection.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Introduction to error handling \n",
"\n",
"## Learning Objectives\n",
"\n",
"After working through this topic, you should be able to:\n",
"\n",
"- Explain why error handling is important\n",
"\n",
"## Materials\n",
"\n",
"Here is the\n",
"[screencast](https://player.uni-bonn.educast.nrw/96b79d38-8313-4025-bfcb-66ccd649e507).\n",
"These are the [slides](software_engineering-error_handling_intro.pdf).\n",
"\n",
"\n",
"\n",
"## Quiz"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"remove-input"
]
},
"outputs": [],
"source": [
"content = {\n",
" \"What are benefits of good error handling\": {\n",
" \"You make fewer mistakes\": False,\n",
" \"You find mistakes earlier\": True,\n",
" \"You understand what went wrong immediately\": True,\n",
" \"Your code is more readable\": False,\n",
" },\n",
"}\n",
"\n",
"from epp_topics.quiz_utilities import display_quiz\n",
"\n",
"display_quiz(content)"
]
}
],
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# How to raise errors?\n",
"\n",
"## Learning Objectives\n",
"\n",
"After working through this topic, you should be able to:\n",
"\n",
"- Use the `raise` keyword to raise errors\n",
"- Decide when to use built-in vs. custom exceptions \n",
"- Define custom exceptions\n",
"- Explain the concept of `fail-functions`\n",
"\n",
"## Materials\n",
"\n",
"Here is the\n",
"[screencast](https://player.uni-bonn.educast.nrw/57b9f591-e18c-47aa-a2cf-5f66bf22846c).\n",
"These are the [slides](software_engineering-raising_errors.pdf).\n",
"\n",
"\n",
"## Quiz"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"remove-input"
]
},
"outputs": [],
"source": [
"content = {\n",
" \"How can you raise exceptions in Python?\": {\n",
" \"With the `raise` keyword\": True,\n",
" \"With the `throw` keyword\": False,\n",
" \"With the `except` keyword\": False,\n",
" \"With the `yield` keyword\": False,\n",
" },\n",
" \"What is the benefit of fail-functions?\": {\n",
" \"They tell you what is checked without cluttering the code\": True,\n",
" \"They let you re-use code for error handling\": True,\n",
" \"They are faster than raising exceptions\": False,\n",
" \"They force you to think about a good name for each check\": True,\n",
" },\n",
" \"What are benefits of custom exceptions\": {\n",
" \"They can be more explicit than the built-in exceptions\": True,\n",
" \"They are faster than built-in exceptions\": False,\n",
" \"They replace the need for good error messages\": False,\n",
" \"They show you are a good programme\": False,\n",
" },\n",
"}\n",
"\n",
"from epp_topics.quiz_utilities import display_quiz\n",
"\n",
"display_quiz(content)"
]
}
],
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Which errors to handle?\n",
"\n",
"## Learning Objectives\n",
"\n",
"After working through this topic, you should be able to:\n",
"\n",
"- Decide for which inputs you need error handling\n",
"- Explain when to use testing instead of error handling\n",
"- Decide where to do error handling\n",
"\n",
"## Materials\n",
"\n",
"Here is the\n",
"[screencast](https://player.uni-bonn.educast.nrw/b728a649-b661-48f7-b13f-d28f92eea888).\n",
"These are the [slides](software_engineering-which_errors_to_handle.pdf).\n",
"\n",
"\n",
"## Quiz"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"remove-input"
]
},
"outputs": [],
"source": [
"content = {\n",
" \"For which inputs of your functions should you do error handling?\": {\n",
" \"Those generated by other functions to make sure those functions work\": False,\n",
" \"Those passed in by a user\": True,\n",
" \"You should do error handling for all inputs of all functions\": False,\n",
" \"Those that use complex data structures\": False,\n",
" },\n",
" \"Where should you do error handling?\": {\n",
" \"As early as possible so users get early feedback\": True,\n",
" \"Right before you use the input\": False,\n",
" \"At the end of the function to check that the result is valid\": False,\n",
" },\n",
"}\n",
"\n",
"from epp_topics.quiz_utilities import display_quiz\n",
"\n",
"display_quiz(content)"
]
}
],
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit 30e795e

Please sign in to comment.