Skip to content

Commit

Permalink
Improved installation instructions and separate installation from bas…
Browse files Browse the repository at this point in the history
…ic python.
  • Loading branch information
janosg committed Oct 20, 2023
1 parent 25e8ef8 commit cbc0aa9
Show file tree
Hide file tree
Showing 175 changed files with 12,473 additions and 1,694 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 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 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 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.
27 changes: 27 additions & 0 deletions _downloads/932540eb00d93aa8e7b88a388b3b61b1/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: epp
channels: [conda-forge, nodefaults]
dependencies:
- estimagic
- nlopt
- jupyter
- matplotlib
- numba
- numpy
- openpyxl
- pandas >= 2.1
- pip
- plotly
- pre-commit
- pyarrow >= 13.0
- pytask >= 0.4
- pytest
- python==3.11
- scikit-learn
- scipy
- seaborn
- statsmodels
- toml
- line_profiler
- snakeviz
- pip: [kaleido, pdbp]
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/a5cd74a273b58b2a37c0fb61b0829873/pandas-datatypes.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 added _images/14_activate_epp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/15_conda_info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/16_execution_policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/17_conda_init.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/18_cmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions _sources/python_installation_execution/content_objectives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Content and Learning Objectives

The topics in this chapter ...

After working through this chapter, you should be able to:

- ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Executing notebooks in a browser\n",
"\n",
"## Learning Objectives\n",
"\n",
"After working through this topic, you should be able to:\n",
"\n",
"- Activate a conda environment in your shell\n",
"- Start jupyter notebooks in your browser from the shell\n",
"\n",
"## Materials\n",
"\n",
"Here is the [screencast](https://player.uni-bonn.educast.nrw/4881691a-00c3-4a83-9fc9-deffac2dcf72) and these are the\n",
"[slides](python_installation_execution-executing_notebook_browser.pdf).\n"
]
}
],
"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,39 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Executing jupyter notebooks in VS Code\n",
"\n",
"## Learning Objectives\n",
"\n",
"After working through this topic, you should be able to:\n",
"\n",
"- Select different jupyter kernels in VS Code\n",
"- Run jupyter notebooks in VS Code\n",
"\n",
"## Materials\n",
"\n",
"Here is the\n",
"[screencast](https://player.uni-bonn.educast.nrw/3988cf3c-9382-481f-98ac-fe14b91fb8f1)\n",
"and these are the [slides](python_installation_execution-executing_notebook_vscode.pdf)."
]
}
],
"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,95 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Executing `.py` files from the shell\n",
"\n",
"## Learning Objectives\n",
"\n",
"After working through this topic, you should be able to:\n",
"\n",
"- Activate a conda environment in your shell\n",
"- Execute python files from your shell\n",
"\n",
"## Materials\n",
"\n",
"We assume that you have already watched the screencasts on installation and have a \n",
"fully working conda installation on your computer. \n",
"\n",
"We also assume that you have watched the screencasts on the shell and know how to \n",
"navigate to directories in a shell. \n",
"\n",
"Here is the\n",
"[screencast](https://player.uni-bonn.educast.nrw/fdb5d582-02db-4ccb-818a-d415de3bef61)\n",
"and these are the [slides](python_installation_execution-executing_py_shell.pdf).\n",
"\n",
"## Quiz"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from jupyterquiz import display_quiz\n",
"\n",
"content = [\n",
" {\n",
" \"question\": (\n",
" \"Your project's folder contains the following files: exercise_1.py, \\\n",
" a folder called data, and a folder called results. Your shell is currently \\\n",
" in the data folder. Which of the following commands would you use to run \\\n",
" the exercise_1.py script?\"\n",
" ),\n",
" \"type\": \"many_choice\",\n",
" \"answers\": [\n",
" {\n",
" \"answer\": \"'python exercise_1.py'\",\n",
" \"correct\": False,\n",
" \"feedback\": \"This would work if you were in the folder containing \\\n",
" exercise_1.py.\",\n",
" },\n",
" {\n",
" \"answer\": \"'python ../exercise_1.py'\",\n",
" \"correct\": True,\n",
" \"feedback\": \"This works because ../ moves you up one folder, \\\n",
" and then you can run the script from there.\",\n",
" },\n",
" {\n",
" \"answer\": \"'python ~/exercise_1.py'\",\n",
" \"correct\": False,\n",
" \"feedback\": \"This would work if you were in your home folder (on a \\\n",
" Mac system).\",\n",
" },\n",
" {\n",
" \"answer\": \"'cd ..' and then 'python exercise_1.py'\",\n",
" \"correct\": True,\n",
" \"feedback\": \"This works because cd .. moves you up one folder, \\\n",
" and then you can run the script from there.\",\n",
" },\n",
" ],\n",
" },\n",
"]\n",
"display_quiz(content, colors=\"fdsp\")"
]
}
],
"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,39 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Executing `.py` files in VS Code\n",
"\n",
"## Learning Objectives\n",
"\n",
"After working through this topic, you should be able to:\n",
"\n",
"- Select different python interpreters in VS Code\n",
"- Run python files in VS Code\n",
"\n",
"## Materials\n",
"\n",
"Here is the\n",
"[screencast](https://player.uni-bonn.educast.nrw/527c21d3-ef88-4e70-a62d-a2261436203f)\n",
"and these are the [slides](python_installation_execution-executing_py_vscode.pdf).\n"
]
}
],
"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,73 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Running Python code via pytask\n",
"\n",
"## Learning Objectives\n",
"\n",
"After working through this topic, you should be able to:\n",
"\n",
"- Execute a reproducible project using pytask\n",
"- Activate the correct environment for using pytask\n",
"\n",
"## Materials\n",
"\n",
"Here is the \n",
"[screencast](https://player.uni-bonn.educast.nrw/993ed1d4-7f3f-45ef-bf1b-664f794490c2) \n",
"and these are the [slides](python_installation_execution-executing_pytask.pdf).\n",
"\n",
"## Additional Materials\n",
"\n",
"- The pytask [command line interface](https://pytask-dev.readthedocs.io/en/stable/reference_guides/command_line_interface.html)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"remove-input"
]
},
"outputs": [],
"source": [
"from epp_topics.quiz_utilities import display_quiz\n",
"\n",
"content = {\n",
" \"In contrast to other ways of executing Python code\": {\n",
" \"Pytask runs multiple .py files at once\": False,\n",
" \"Pytask runs functions instead of entire `.py` files\": True,\n",
" \"Pytask works for notebooks and `.py` files\": False,\n",
" \"Pytasks automatically install all dependencies for you\": False,\n",
" },\n",
" \"Which of the following is true?\": {\n",
" \"Pytask saves runtime by executing only tasks that need to be executed\": True,\n",
" \"Pytask only works if you define functions\": True,\n",
" \"If you use pytask, you don't need git\": False,\n",
" \"Pytask requires a very specific directory structure\": False,\n",
" },\n",
"}\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,73 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Running Python code via pytest\n",
"\n",
"## Learning Objectives\n",
"\n",
"After working through this topic, you should be able to:\n",
"\n",
"- Execute all tests in a project using pytest\n",
"- Activate the correct environment for using pytest\n",
"\n",
"## Materials\n",
"\n",
"Here is the \n",
"[screencast](https://player.uni-bonn.educast.nrw/31bef7c1-79cf-4281-98a8-3187d0ea9bdc) \n",
"and these are the [slides](python_installation_execution-executing_pytest.pdf).\n",
"\n",
"## Additional Materials\n",
"\n",
"- The pytest \n",
" [command line interface](https://docs.pytest.org/en/stable/how-to/usage.html)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"remove-input"
]
},
"outputs": [],
"source": [
"from epp_topics.quiz_utilities import display_quiz\n",
"\n",
"content = {\n",
" \"In contrast to other ways of executing Python code\": {\n",
" \"Pytest runs multiple .py files at once\": False,\n",
" \"Pytest runs functions instead of entire `.py` files\": True,\n",
" \"Pytest works for notebooks and `.py` files\": False,\n",
" \"Pytests automatically install all dependencies for you\": False,\n",
" },\n",
" # \"Which of the following is true?\": {\n",
" # \"Pytest only works if you define functions\": True,\n",
" # \"If you use pytest, you don't need git\": False,\n",
" # \"Pytest requires a very specific directory structure\": False,\n",
" # },\n",
"}\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 cbc0aa9

Please sign in to comment.