Fabian Neumann committed Jun 04, 2019 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ``````# Tutorial Structure ## Worksheets and Material The tutorials include both, coding exercises and calculations done by hand. There's a worksheet (`sheet-0X.pdf`) for every tutorial in `tutorial-X/worksheet`. If the tutorial includes coding exercises (some tutorials have no coding exercises), there are `jupyter notebooks` (`tutorial-X-task-Y.ipynb`) and data sources provided in `tutorial-X/notebooks`. ## Solutions Solutions for coding exercises and calculations by hand are also included in the repository. * See `tutorial-X/notebooks/tutorial-X-task-Y-solution.ipynb` for solutions to coding exercises. * See `tutorial-X/worksheet/solution-0X.pdf` for solutions to calculations done by hand. You may refer to them at any time, but (needless to say) it is best if you try without first. `````` Fabian Neumann committed Jun 04, 2019 22 ``````# Python Tutorials `````` fabian.neumann committed Jun 30, 2018 23 `````` `````` Fabian Neumann committed Jun 04, 2019 24 ``````In the tutorials we will repeatedly work with the programming language Python. If you are unfamiliar with the language, you might find the following tutorials useful. `````` fabian.neumann committed Jun 30, 2018 25 `````` `````` Fabian Neumann committed Jun 04, 2019 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 ``````The [Python notebook based notes of Robert Johansson](http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/tree/master/) are a comprehensive kick starter. * [Lecture 0](http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-0-Scientific-Computing-with-Python.ipynb) covers installation and getting ready. * [Lecture 1](http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-1-Introduction-to-Python-Programming.ipynb) zooms through most basic general python control structures (only brush over it and stop reading early, i.e. if you read the word `classes` you already know too much). * [Lecture 2](http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-2-Numpy.ipynb) is the most important and closely connected to the exercises. * You might as well stop now, but if you are hooked, have a look at [Lecture 3](http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-3-Scipy.ipynb) for more physics and [Lecture 4](http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb) for prettier graphs. Further reference material of help is are the website-books http://python-course.eu/ (English), http://python-kurs.eu/ (German); especially of interest might be the [pandas](http://www.python-course.eu/pandas.php) bit in the end, which will make the exercises a breeze at the expense of yet another package to learn. # Downloading Tutorial Material You can download the tutorials with `git` with the following command: ```bash cd /path/where/your/tutorial/folder/should/be `````` fabian.neumann committed Jun 30, 2018 44 45 ``````git clone https://git.scc.kit.edu/sp2668/esm_tutorials.git ``` `````` fabian.neumann committed Jul 11, 2018 46 ``````or `````` Fabian Neumann committed Jun 04, 2019 47 48 `````````bash cd /path/where/your/tutorial/folder/should/be `````` fabian.neumann committed Jul 11, 2018 49 50 ``````git clone git@git.scc.kit.edu:sp2668/esm_tutorials.git ``` `````` Fabian Neumann committed Jun 04, 2019 51 ``````if you have `ssh` setup at `git.scc.kit.edu`. `````` fabian.neumann committed Jun 30, 2018 52 `````` `````` Fabian Neumann committed Jun 04, 2019 53 ``````Alternatively, (not as nice as description above) you can download the tutorials as compressed zip-file from `````` jonas.hoersch committed Jul 09, 2018 54 ``````https://git.scc.kit.edu/sp2668/esm_tutorials/-/archive/master/esm_tutorials-master.zip `````` fabian.neumann committed Jun 30, 2018 55 `````` `````` sp2668 committed Jun 30, 2018 56 57 ``````# Installation Guide `````` Fabian Neumann committed Jun 04, 2019 58 59 60 61 ``````**If you happen to come across this before the tutorials start, you may already want to follow the installation instructions already to get started right away.** We recommend using the package manager and environment management system `conda` to install the packages we need. `````` jonas.hoersch committed Jul 09, 2018 62 `````` `````` Fabian Neumann committed Jun 04, 2019 63 64 ``````Install [`miniconda`](https://conda.io/docs/user-guide/install/index.html) (or Anaconda). For instructions for your operating system see https://conda.io/docs/user-guide/install/index.html. `````` sp2668 committed Jun 30, 2018 65 `````` `````` Fabian Neumann committed Jun 04, 2019 66 ``````Create a new `conda` environment from the provided `environment.yaml` file with the following set of commands: `````` sp2668 committed Jun 30, 2018 67 68 `````` Windows: `````` Fabian Neumann committed Jun 04, 2019 69 `````````bash `````` Fabian Neumann committed Jun 04, 2019 70 ``````conda env create -f environment.yaml `````` sp2668 committed Jun 30, 2018 71 72 73 ``````activate esm-tutorials ``` `````` fabian.neumann committed Jun 30, 2018 74 ``````macOS and Linux: `````` Fabian Neumann committed Jun 04, 2019 75 `````````bash `````` Fabian Neumann committed Jun 04, 2019 76 ``````conda env create -f environment.yaml `````` Fabian Neumann committed Jun 04, 2019 77 78 79 80 81 82 ``````conda activate esm-tutorials ``` On some older Linux installations the last command can be instead ```bash `````` sp2668 committed Jun 30, 2018 83 84 85 ``````source activate esm-tutorials ``` `````` Fabian Neumann committed Jun 04, 2019 86 87 88 89 90 91 92 93 94 95 ``````For detailed instructions see https://conda.io/docs/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file. It will take some time! With the `conda` environment installed and activated, open a jupyter notebook/lab with the following command in the tutorial folder (where your notebooks are): ```bash cd /path/where/your/tutorial/folder/should/be cd esm-tutorials jupyter lab `````` sp2668 committed Jun 30, 2018 96 ````````` `````` Fabian Neumann committed Jun 04, 2019 97 98 99 100 101 102 `````` or ```bash cd /path/where/your/tutorial/folder/should/be cd esm-tutorials `````` sp2668 committed Jun 30, 2018 103 104 105 ``````jupyter notebook ``` `````` Fabian Neumann committed Jun 04, 2019 106 ``You should now be ready to do the tutorials :)``