Skip to content

Commit

Permalink
Add 6th seminar
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhronec committed Nov 15, 2022
1 parent af7cedc commit f7890ca
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions 06_seminar/06_seminar.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Seminar 3\n",
"\n",
"15th of November 2022 \n",
"\n",
"by Martin Hronec \n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part 0: Midterm solution walkthrough"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part I: Importing from a module\n",
"\n",
"1. define function `fun` in separate python script (module) `mod.py` located in the current working directory\n",
"2. import the fuction `fun` to this jupyter\n",
"3. move the script `mod.py` from point 1 to other directory\n",
"4. list the module search path\n",
"5. import the function `fun` (after moving the script from point 1) by modifying the search path"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part II: Package your code\n",
"1. create separate directory called funpack and move python script `mod.py` defined in Part 1 to the subdirectory named the same, i.e. `funpack/mod.py`\n",
"2. add additional script called `funtils.py` to the same subdirectory, i.e. `funpack/funtils.py`\n",
"3. create requirements.txt \n",
"4. make *funpack* into installable Python package using setuptools\n",
"5. install your *funpack* package on your machine\n",
"6. make *funpack* directory into a Git repository and push it to the GitHub\n",
"7. make *funpack* GitHub repository public\n",
"8. fork & clone your colleagues "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part III: Document your code\n",
"0. add annotation to your function\n",
"1. create docstrings (using [Google docstings format](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings)) for all the functions in your *funpack* package\n",
"2. add default mkdocs documentation to your project\n",
"3. serve it using localhost\n",
"4. change the name of the site\n",
"5. add page called \"About\" to the site\n",
"6. use [mkdocstrings](https://mkdocstrings.github.io/) to automatically generate documentation for functions used in the `funpack` package\n",
"7. add automatically generated documentation as a \"Reference\" to your documentation site "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part IV: Test your code\n",
"\n",
"1. Create a test for function `mod.capitalize`\n",
"2. Create a test for function `mod.reverse`\n",
"3. Run tests from 1 and 2\n",
"4. Create a fixture containing a string for testing tests in 1 and 2 \n",
"5. Modify tests 1 and 2 to use the fixture created in 4"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.10.7 64-bit",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.7"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "1f0e6d99f3103fd78365fe1cf7b2d51239fa0878786db9cbdfe89bc88a3151d3"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit f7890ca

Please sign in to comment.