Skip to content

Commit 3335378

Browse files
committed
fix: tuto paths by adding the IDEFIX_TUTORIAL_DIR env variable
1 parent 8daa2f6 commit 3335378

6 files changed

Lines changed: 22 additions & 19 deletions

File tree

Readme.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ In the directory of your choice, you then clone the tutorial to the directory `i
2020

2121
```shell
2222
git clone --branch asnum2026 https://github.com/idefix-code/tutorial.git ./idefix-tutorial
23+
export IDEFIX_TUTORIAL_DIR="$PWD/idefix-tutorial"
24+
cd "$IDEFIX_TUTORIAL_DIR"
2325
```
2426

2527
We then create a python environement, install what we need, and launch a jupyter lab session
2628
```shell
27-
python3 -m venv ./idefix-env
28-
source idefix-env/bin/activate
29-
pip install -r ./idefix-tutorial/python_requirements.txt
29+
cd "$IDEFIX_TUTORIAL_DIR"
30+
python3 -m venv ./idefix.env
31+
source idefix.env/bin/activate
32+
pip install -r ./python_requirements.txt
3033
jupyter lab --sock=~/mysock.sock
3134
```
3235

@@ -36,7 +39,7 @@ you're now good to go. On your laptop, using your favourite browser, open the li
3639
http://localhost:8888/lab?token=<your_token>
3740
```
3841

39-
Which should open your jupyter lab session running on the distant machine. From there, go to the tutorial directory `idefix-tutorial` created above, and open `start.ipynb`.
42+
Which should open your jupyter lab session running on the distant machine. From there, open `start.ipynb`.
4043

4144

4245

SimpleSetup/problem1/read_problem.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"import os\n",
1313
"import sys\n",
1414
"# Possibly adapt the idefix path depending on where you cloned the sources\n",
15-
"sys.path.append(\"../../../idefix.src\")\n",
15+
"sys.path.append(\"../../idefix.src\")\n",
1616
"from pytools.vtk_io import readVTK\n",
1717
"import matplotlib.pyplot as plt\n",
1818
"import numpy as np"

SimpleSetup/solution1/read_problem.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"import os\n",
1313
"import sys\n",
1414
"# Possibly adapt the idefix path depending on where you cloned the sources\n",
15-
"sys.path.append(\"../../../idefix.src\")\n",
15+
"sys.path.append(\"../../idefix.src\")\n",
1616
"from pytools.vtk_io import readVTK\n",
1717
"import matplotlib.pyplot as plt\n",
1818
"import numpy as np"
@@ -96,7 +96,7 @@
9696
"name": "python",
9797
"nbconvert_exporter": "python",
9898
"pygments_lexer": "ipython3",
99-
"version": "3.12.3"
99+
"version": "3.13.5"
100100
}
101101
},
102102
"nbformat": 4,

VisualisationAndPost/nonos/Intro_to_nonos.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@
549549
"name": "python",
550550
"nbconvert_exporter": "python",
551551
"pygments_lexer": "ipython3",
552-
"version": "3.10.14"
552+
"version": "3.13.5"
553553
}
554554
},
555555
"nbformat": 4,

VisualisationAndPost/readVTK/Direct_VTK_visualisation.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"import os\n",
4747
"import sys\n",
4848
"# Possibly adapt the idefix path depending on where you cloned the sources\n",
49-
"sys.path.append(\"../../../idefix.src/\")\n",
49+
"sys.path.append(\"../../idefix.src/\")\n",
5050
"from pytools.vtk_io import readVTK"
5151
]
5252
},
@@ -320,7 +320,7 @@
320320
"name": "python",
321321
"nbconvert_exporter": "python",
322322
"pygments_lexer": "ipython3",
323-
"version": "3.12.3"
323+
"version": "3.13.5"
324324
}
325325
},
326326
"nbformat": 4,

start.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"For this tutorial, we have prepared and tested environement for each machine (dgx, h200 and pocamd). You just need to source the right environement from `idefix-tutorial/environement/xxx.sh` in your terminal window. e.g. on dgx:\n",
138138
"\n",
139139
"```shell\n",
140-
"source <path_to_idefix_tutorial>/environements/dgx.sh\n",
140+
"source $IDEFIX_TUTORIAL_DIR/environements/dgx.env\n",
141141
"```\n",
142142
"\n",
143143
"Don't forget to source this environement each time you open a new terminal on the target machine.\n",
@@ -213,7 +213,7 @@
213213
"For this first simple setup, we move in the SimpleSetup/problem1 directory of the tutorial. i.e\n",
214214
"\n",
215215
"```shell\n",
216-
"cd <path_to_idefix_tutorial>/SimpleSetup/problem1/\n",
216+
"cd $IDEFIX_TUTORIAL_DIR/SimpleSetup/problem1/\n",
217217
"```\n",
218218
"\n",
219219
"## What is an idefix setup?\n",
@@ -278,7 +278,7 @@
278278
"import os\n",
279279
"import sys\n",
280280
"# Possibly adapt the idefix path depending on where you cloned the sources\n",
281-
"sys.path.append(\"../idefix.src\")\n",
281+
"sys.path.append(\"idefix.src\")\n",
282282
"from pytools.vtk_io import readVTK\n",
283283
"import matplotlib.pyplot as plt\n",
284284
"import numpy as np"
@@ -402,7 +402,7 @@
402402
"We first move to the problem directory\n",
403403
"\n",
404404
"```shell\n",
405-
"cd <path_to_idefix_tutorial>/PythonSetup/problem/\n",
405+
"cd $IDEFIX_TUTORIAL_DIR/PythonSetup/problem/\n",
406406
"```\n",
407407
"\n",
408408
"## Your tasks\n",
@@ -465,7 +465,7 @@
465465
"For now, lets move to the problem directory\n",
466466
"\n",
467467
"```shell\n",
468-
"cd idefix-tutorial/AdvancedSetup/problem1\n",
468+
"cd $IDEFIX_TUTORIAL_DIR/AdvancedSetup/problem1\n",
469469
"```"
470470
]
471471
},
@@ -657,7 +657,7 @@
657657
"The first problem is a simple 1D shock tube problem. This can be compiled and run on your laptop or on a cluster.\n",
658658
"\n",
659659
"```shell\n",
660-
"cd idefix-tutorial/Debugging/problem1\n",
660+
"cd $IDEFIX_TUTORIAL_DIR/Debugging/problem1\n",
661661
"```\n",
662662
"\n",
663663
"We then configure, compile and run the code\n",
@@ -740,7 +740,7 @@
740740
"The second problem is a pure thermal diffusion problem where the gas is kept fixed with 0 velocity. This can be compiled and run *on your laptop*.\n",
741741
"\n",
742742
"```shell\n",
743-
"cd idefix-tutorial/Debugging/problem2\n",
743+
"cd $IDEFIX_TUTORIAL_DIR/Debugging/problem2\n",
744744
"```\n",
745745
"\n",
746746
"We then configure, compile and run the code\n",
@@ -861,7 +861,7 @@
861861
"Let's move to problem 4, which is again a planet-disk interraction problem. This can be compiled and run *on your laptop* or on the on a cluster, but let's focus for now on the GPU version on the a cluster (you can try to do the exercise on your laptop). First go to the right directory\n",
862862
"\n",
863863
"```shell\n",
864-
"cd idefix-tutorial/Debugging/problem4\n",
864+
"cd $IDEFIX_TUTORIAL_DIR/Debugging/problem4\n",
865865
"```\n",
866866
"\n",
867867
"We then configure\n",
@@ -909,7 +909,7 @@
909909
{
910910
"cell_type": "code",
911911
"execution_count": null,
912-
"id": "68fea61b-5fa3-4cfe-85a6-c170b43aeaec",
912+
"id": "0e28f9fb-0dc0-4e35-9eca-8ae4254c4529",
913913
"metadata": {},
914914
"outputs": [],
915915
"source": []

0 commit comments

Comments
 (0)