Commit d5c1e69e authored by paugier's avatar paugier
Browse files

Site builds

parent 34958c43
IPYNBDIR := ipynb
IPYNBFILES := $(shell find $(IPYNBDIR) -name '*.ipynb' | grep -v ipynb_checkpoints)
IPYNBPRES = $(addsuffix .slides.html, $(basename $(IPYNBFILES)))
define STR_HELP
This makefile can be used for
......@@ -37,9 +33,10 @@ ipynb/index.html: ipynb/index.rst
cd $(IPYNBDIR) && rst2html5 index.rst > index.html
%.slides.html: %.ipynb ipynb/slides_reveal_wide.tpl
jupyter-nbconvert $< --reveal-prefix='./reveal.js' --to slides --template ipynb/slides_reveal_wide.tpl
jupyter-nbconvert $< --reveal-prefix='./reveal.js' --to slides --template ipynb/slides_reveal_wide.tpl
presentations: $(IPYNBPRES) ipynb/index.html
echo $(IPYNBPRES)
serve: $(IPYNBPRES) ipynb/index.html
cd $(IPYNBDIR) && python3 -m http.server 9000
## To be done before the first day of the training session
# Setup your environment
We will have to use Python 3 (with Miniconda3), a good Python IDE (either
Spyder or VSCode), Jupyter and a version-control tool (Mercurial, or Git if you
know it and really like it).
In the following, we give indications about how to install these tools and how
to get the repository of this training locally on your computer. Please, try to
do this before the training and tell us if you encounter problems. You can fill
an issue
[here](https://gricad-gitlab.univ-grenoble-alpes.fr/python-uga/training-hpc/issues)
to get the repository of this training locally on your computer. Please, if you
encounter problems, fill an issue
[here](https://gricad-gitlab.univ-grenoble-alpes.fr/augierpi/scientific-computing-m2-efm/issues)
to explain what you did and what are the errors (please copy / paste the error
log).
......@@ -19,7 +18,7 @@ macOS are less adapted for this particular application. Python is a
cross-platform language but nevertheless, you will get a better experience for
HPC with Python on Linux.
#### Install Python and utilities
#### Install miniconda and Python
The first step is to install miniconda3 (see
[here](https://docs.conda.io/en/latest/miniconda.html))
......@@ -85,12 +84,12 @@ repository of the training with:
```hg clone https://gricad-gitlab.univ-grenoble-alpes.fr/augierpi/intro-python.git```
Please tell us before the training if it does not work.
Please tell us if it does not work.
#### Install few packages in your base conda environment
```
cd intro-python
cd scientific-computing-m2-efm
conda install --file requirements.txt
```
......
Scientific computing 2020
=========================
- `Introduction <introduction.slides.html>`_
- `Introduction Bash <intro_bash.slides.html>`_
- `pres00 intro + first step <pres00_intro_first_steps.slides.html>`_ (~ 1h)
- `pres01_intro_language <pres01_intro_language.slides.html>`_ (~ 1h30)
- `pres02_basic_statements <pres02_basic_statements.slides.html>`_ (~ 2h30)
- `pres03_functions.slides <pres03_functions.slides.html>`_ (~ 1h30)
- `pres04_readwritefiles <pres04_readwritefiles.slides.html>`_ (20 min)_
- `pres06_import_standard_library <pres06_import_standard_library.slides.html>`_ (1h)
- `pres07_data_struct <pres07_data_struct.slides.html>`_ (~40 min)
- `pres080_oop_encapsulation <pres080_oop_encapsulation.slides.html>`_ (~20 min)
- `pres081_oop_inheritance <pres081_oop_inheritance.slides.html>`_ (~20 min)
- `pres10_environnement <pres10_environnement.slides.html>`_
- `pres110_intro_numpy_scipy_pandas <pres110_intro_numpy_scipy_pandas.slides.html>`_
- `pres111_intro_matplotlib <pres111_intro_matplotlib.slides.html>`_
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/pierre/Output/teach/intro-python/ipynb\n"
]
}
],
"source": [
"pwd"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"cd .."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"AUTHORS.txt install.md LICENSE.txt notes.rst README.rst setup.py\n",
"check_env.py \u001b[0m\u001b[01;34mipynb\u001b[0m Makefile \u001b[01;34mpyfiles\u001b[0m requirements.txt \u001b[01;34mTP\u001b[0m\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"total 68\n",
"-rw-r--r-- 1 pierre pierre 194 oct. 10 23:13 AUTHORS.txt\n",
"-rw-r--r-- 1 pierre pierre 641 oct. 10 23:13 check_env.py\n",
"-rw-r--r-- 1 pierre pierre 3761 oct. 10 23:57 install.md\n",
"drwxr-xr-x 5 pierre pierre 4096 oct. 11 00:19 \u001b[0m\u001b[01;34mipynb\u001b[0m\n",
"-rw-r--r-- 1 pierre pierre 21778 oct. 10 23:13 LICENSE.txt\n",
"-rw-r--r-- 1 pierre pierre 924 oct. 10 23:13 Makefile\n",
"-rw-r--r-- 1 pierre pierre 1867 oct. 10 23:13 notes.rst\n",
"drwxr-xr-x 4 pierre pierre 4096 oct. 10 23:13 \u001b[01;34mpyfiles\u001b[0m\n",
"-rw-r--r-- 1 pierre pierre 1329 oct. 10 23:13 README.rst\n",
"-rw-r--r-- 1 pierre pierre 196 oct. 11 00:17 requirements.txt\n",
"-rw-r--r-- 1 pierre pierre 135 oct. 10 23:13 setup.py\n",
"drwxr-xr-x 9 pierre pierre 4096 oct. 10 23:13 \u001b[01;34mTP\u001b[0m\n"
]
}
],
"source": [
"ls -l"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[0m\u001b[01;34m.\u001b[0m .gitignore \u001b[01;34mipynb\u001b[0m \u001b[01;34mpyfiles\u001b[0m \u001b[01;34mTP\u001b[0m\n",
"\u001b[01;34m..\u001b[0m .gitlab-ci.yml LICENSE.txt README.rst\n",
"AUTHORS.txt \u001b[01;34m.hg\u001b[0m Makefile requirements.txt\n",
"check_env.py install.md notes.rst setup.py\n"
]
}
],
"source": [
"ls -a"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"total 88\n",
"drwxr-xr-x 6 pierre pierre 4096 oct. 11 00:18 \u001b[0m\u001b[01;34m.\u001b[0m\n",
"drwxr-xr-x 4 pierre pierre 4096 oct. 11 00:07 \u001b[01;34m..\u001b[0m\n",
"-rw-r--r-- 1 pierre pierre 194 oct. 10 23:13 AUTHORS.txt\n",
"-rw-r--r-- 1 pierre pierre 641 oct. 10 23:13 check_env.py\n",
"-rw-r--r-- 1 pierre pierre 190 oct. 10 23:13 .gitignore\n",
"-rw-r--r-- 1 pierre pierre 326 oct. 10 23:13 .gitlab-ci.yml\n",
"drwxr-xr-x 5 pierre pierre 4096 oct. 11 00:03 \u001b[01;34m.hg\u001b[0m\n",
"-rw-r--r-- 1 pierre pierre 3761 oct. 10 23:57 install.md\n",
"drwxr-xr-x 5 pierre pierre 4096 oct. 11 00:19 \u001b[01;34mipynb\u001b[0m\n",
"-rw-r--r-- 1 pierre pierre 21778 oct. 10 23:13 LICENSE.txt\n",
"-rw-r--r-- 1 pierre pierre 924 oct. 10 23:13 Makefile\n",
"-rw-r--r-- 1 pierre pierre 1867 oct. 10 23:13 notes.rst\n",
"drwxr-xr-x 4 pierre pierre 4096 oct. 10 23:13 \u001b[01;34mpyfiles\u001b[0m\n",
"-rw-r--r-- 1 pierre pierre 1329 oct. 10 23:13 README.rst\n",
"-rw-r--r-- 1 pierre pierre 196 oct. 11 00:17 requirements.txt\n",
"-rw-r--r-- 1 pierre pierre 135 oct. 10 23:13 setup.py\n",
"drwxr-xr-x 9 pierre pierre 4096 oct. 10 23:13 \u001b[01;34mTP\u001b[0m\n"
]
}
],
"source": [
"ls -la"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"cd ipynb"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/pierre/Output/teach/intro-python/ipynb\n"
]
}
],
"source": [
"pwd"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"cd .."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"AUTHORS.txt install.md LICENSE.txt notes.rst README.rst setup.py\n",
"check_env.py \u001b[0m\u001b[01;34mipynb\u001b[0m Makefile \u001b[01;34mpyfiles\u001b[0m requirements.txt \u001b[01;34mTP\u001b[0m\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"mkdir toto"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"AUTHORS.txt \u001b[0m\u001b[01;34mipynb\u001b[0m notes.rst requirements.txt \u001b[01;34mTP\u001b[0m\n",
"check_env.py LICENSE.txt \u001b[01;34mpyfiles\u001b[0m setup.py\n",
"install.md Makefile README.rst \u001b[01;34mtoto\u001b[0m\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"rm -rf toto"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/bin/ls\n"
]
}
],
"source": [
"which ls"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"toto\n"
]
}
],
"source": [
"echo \"toto\""
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/pierre/miniconda3/condabin/app:/home/pierre/opt/julia-1.0.2/bin/:/home/pierre/.pyenv/shims:/home/pierre/.pyenv/bin:/home/pierre/.cask/bin:.local/bin/:/home/pierre/.pyenv/versions/3.7.4/bin:/home/pierre/.pyenv/libexec:/home/pierre/.pyenv/plugins/python-build/bin:/home/pierre/.pyenv/shims:/home/pierre/.pyenv/bin:/home/pierre/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/pierre/.cask/bin:/home/pierre/.local/bin/:/home/pierre/opt/julia-1.0.2/bin/\n"
]
}
],
"source": [
"echo $PATH"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/pierre\n"
]
}
],
"source": [
"echo $HOME"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"AUTHORS.txt install.md LICENSE.txt notes.rst README.rst setup.py\n",
"check_env.py \u001b[0m\u001b[01;34mipynb\u001b[0m Makefile \u001b[01;34mpyfiles\u001b[0m requirements.txt \u001b[01;34mTP\u001b[0m\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"echo \"toto\" > tmp.txt"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"AUTHORS.txt \u001b[0m\u001b[01;34mipynb\u001b[0m notes.rst requirements.txt \u001b[01;34mTP\u001b[0m\n",
"check_env.py LICENSE.txt \u001b[01;34mpyfiles\u001b[0m setup.py\n",
"install.md Makefile README.rst tmp.txt\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"toto\n"
]
}
],
"source": [
"cat tmp.txt"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
"echo \"titi\" >> tmp.txt"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"toto\n",
"titi\n"
]
}
],
"source": [
"cat tmp.txt"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"mv tmp.txt tmp2.txt"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"AUTHORS.txt \u001b[0m\u001b[01;34mipynb\u001b[0m notes.rst requirements.txt \u001b[01;34mTP\u001b[0m\n",
"check_env.py LICENSE.txt \u001b[01;34mpyfiles\u001b[0m setup.py\n",
"install.md Makefile README.rst tmp2.txt\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"mv tmp2.txt .."
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[0m\u001b[01;34mcoursem1_pa_instabilities_turbulence\u001b[0m \u001b[01;34mintro-python\u001b[0m tmp2.txt\n"
]
}
],
"source": [
"ls .."
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"rm -f ../tmp2.txt"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[0m\u001b[01;34mcoursem1_pa_instabilities_turbulence\u001b[0m \u001b[01;34mintro-python\u001b[0m\n"
]
}
],
"source": [
"ls .."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Bash",
"language": "bash",
"name": "bash"
},
"language_info": {
"codemirror_mode": "shell",
"file_extension": ".sh",
"mimetype": "text/x-sh",
"name": "bash"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
%% Cell type:code id: tags:
``` bash
pwd
```
%%%% Output: stream
/home/pierre/Output/teach/intro-python/ipynb
%% Cell type:code id: tags:
``` bash
cd ..
```
%% Cell type:code id: tags:
``` bash
ls
```
%%%% Output: stream
AUTHORS.txt install.md LICENSE.txt notes.rst README.rst setup.py
check_env.py ipynb Makefile pyfiles requirements.txt TP
%% Cell type:code id: tags:
``` bash
ls -l
```
%%%% Output: stream
total 68
-rw-r--r-- 1 pierre pierre 194 oct. 10 23:13 AUTHORS.txt
-rw-r--r-- 1 pierre pierre 641 oct. 10 23:13 check_env.py
-rw-r--r-- 1 pierre pierre 3761 oct. 10 23:57 install.md
drwxr-xr-x 5 pierre pierre 4096 oct. 11 00:19 ipynb
-rw-r--r-- 1 pierre pierre 21778 oct. 10 23:13 LICENSE.txt
-rw-r--r-- 1 pierre pierre 924 oct. 10 23:13 Makefile
-rw-r--r-- 1 pierre pierre 1867 oct. 10 23:13 notes.rst
drwxr-xr-x 4 pierre pierre 4096 oct. 10 23:13 pyfiles
-rw-r--r-- 1 pierre pierre 1329 oct. 10 23:13 README.rst
-rw-r--r-- 1 pierre pierre 196 oct. 11 00:17 requirements.txt
-rw-r--r-- 1 pierre pierre 135 oct. 10 23:13 setup.py
drwxr-xr-x 9 pierre pierre 4096 oct. 10 23:13 TP
%% Cell type:code id: tags:
``` bash
ls -a
```
%%%% Output: stream
. .gitignore ipynb pyfiles TP
.. .gitlab-ci.yml LICENSE.txt README.rst
AUTHORS.txt .hg Makefile requirements.txt
check_env.py install.md notes.rst setup.py
%% Cell type:code id: tags:
``` bash
ls -la
```
%%%% Output: stream
total 88
drwxr-xr-x 6 pierre pierre 4096 oct. 11 00:18 .
drwxr-xr-x 4 pierre pierre 4096 oct. 11 00:07 ..
-rw-r--r-- 1 pierre pierre 194 oct. 10 23:13 AUTHORS.txt
-rw-r--r-- 1 pierre pierre 641 oct. 10 23:13 check_env.py
-rw-r--r-- 1 pierre pierre 190 oct. 10 23:13 .gitignore
-rw-r--r-- 1 pierre pierre 326 oct. 10 23:13 .gitlab-ci.yml
drwxr-xr-x 5 pierre pierre 4096 oct. 11 00:03 .hg
-rw-r--r-- 1 pierre pierre 3761 oct. 10 23:57 install.md
drwxr-xr-x 5 pierre pierre 4096 oct. 11 00:19 ipynb
-rw-r--r-- 1 pierre pierre 21778 oct. 10 23:13 LICENSE.txt
-rw-r--r-- 1 pierre pierre 924 oct. 10 23:13 Makefile
-rw-r--r-- 1 pierre pierre 1867 oct. 10 23:13 notes.rst
drwxr-xr-x 4 pierre pierre 4096 oct. 10 23:13 pyfiles
-rw-r--r-- 1 pierre pierre 1329 oct. 10 23:13 README.rst
-rw-r--r-- 1 pierre pierre 196 oct. 11 00:17 requirements.txt
-rw-r--r-- 1 pierre pierre 135 oct. 10 23:13 setup.py
drwxr-xr-x 9 pierre pierre 4096 oct. 10 23:13 TP
%% Cell type:code id: tags:
``` bash
cd ipynb
```
%% Cell type:code id: tags:
``` bash
pwd
```
%%%% Output: stream
/home/pierre/Output/teach/intro-python/ipynb
%% Cell type:code id: tags:
``` bash
cd ..
```
%% Cell type:code id: tags:
``` bash
ls
```
%%%% Output: stream
AUTHORS.txt install.md LICENSE.txt notes.rst README.rst setup.py
check_env.py ipynb Makefile pyfiles requirements.txt TP
%% Cell type:code id: tags:
``` bash
mkdir toto
```
%% Cell type:code id: tags:
``` bash
ls
```
%%%% Output: stream