Skip to content
Snippets Groups Projects
Verified Commit 505fae88 authored by Lukas Kluft's avatar Lukas Kluft
Browse files

Add presenter notes to all slides

parent 5823aa36
No related branches found
No related tags found
No related merge requests found
Pipeline #69536 passed
......@@ -27,6 +27,10 @@ author:
![](static/Python-logo-notext.svg)
:::
:::{.notes}
Python is around for decades and has a immense user community driving the development of various projects.
:::
::::
# Interpreter
......@@ -42,6 +46,10 @@ author:
print("Hello world!")
```
:::{.notes}
Because python code is not compiled, the result at runtime depends on the script **and** the interpreter.
:::
# Standard library
* Python code is organized in [modules](https://docs.python.org/3/tutorial/modules.html) and [packages](https://docs.python.org/3/tutorial/modules.html#packages)
......@@ -70,12 +78,21 @@ In Python, the term "library" is only used in the context of the standard librar
python3 -m pip install numpy
```
:::{.notes}
It straight-forward to install external packages in addition to the standard library of your interpetor
:::
# Package manager
* A package manager helps you to install different versions of packages and their dependencies
* General purpose package manager (`brew`, `apt-get`, `conda`, ...)
* Python package manager (`pip`, `conda`, ...)
:::{.notes}
While `pip` is **part of** the standard library, you need an interpreter to run it.
General purpose package managers can help to install different python interpreters/versions.
:::
# Virtual environments
* Allows you to have a specific combination of libraries/binaries/packages for a project
......@@ -83,6 +100,12 @@ In Python, the term "library" is only used in the context of the standard librar
* [`venv`](https://docs.python.org/3/library/venv.html) (formerly known as `virutalenv`) is shipped with the standard library
* Tools to handle general software environments (e.g. `conda`)
:::{.notes}
An increasing number of packages in an environment makes the dependence resolution difficult.
It is best, to have smaller individual environments for a dedicated task.
This makes the environment easier to reproduce, to test, and to maintain.
:::
# (Ana)conda
* `conda` is a general purpose package manager
......@@ -92,6 +115,10 @@ In Python, the term "library" is only used in the context of the standard librar
_iv)_ and other software/libraries (e.g. ecCodes, NetCDF, ...)
* Due to restricted system permissions, `conda` became quite popular among HPC users
:::{.notes}
`conda` is a general purpose package manager that can handle virutal environments with different python versions.
:::
# The amazing world of snakes {.national}
:::: {.columns}
......@@ -109,7 +136,7 @@ In Python, the term "library" is only used in the context of the standard librar
![](static/anaconda.jpg)
* Among the heaviest snakes on Earth
* Heaviest snakes on Earth (up to 90 kg)
:::
::: {.column width="30%"}
......@@ -151,6 +178,10 @@ In Python, the term "library" is only used in the context of the standard librar
python3 -m pip install gribscan
```
:::{.notes}
`micromamba` is the easiest solution to setup a python environment on any system.
:::
# Recreating an environment
Specify environment name, python version and dependencies:
......@@ -173,6 +204,11 @@ mamba env create -f environment.yaml
mamba activate my_env
```
:::{.notes}
You **should** create environments from an `environment.yaml`.
This approach improves documentation and reproducibility.
:::
# Excursion: Ipython kernels
* Make an environment usable in Jupyterhub
......@@ -187,7 +223,7 @@ mamba activate my_env
```
* The environment is now available as kernel in jupyter
# Conclusions
# Take-office messages
* Use virtual environments to organize dependencies for your projects
* Keep track of installed packages using an `environment.yaml` file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment