Skip to content

Commit 9b16a24

Browse files
hamelphiTorax team
authored andcommitted
Use QLKNN_7_11 by default.
PiperOrigin-RevId: 732238534
1 parent 0554b3c commit 9b16a24

32 files changed

+130
-16
lines changed

.github/workflows/pytest.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ jobs:
6363
with:
6464
python-version: ${{ matrix.python-version }}
6565

66-
- run: git clone https://gitlab.com/qualikiz-group/qlknn-hyper.git
67-
- run: echo "TORAX_QLKNN_MODEL_PATH=$PWD/qlknn-hyper" >> "$GITHUB_ENV"
68-
6966
- run: pip --version
67+
68+
- run: git clone https://github.com/google-deepmind/fusion_transport_surrogates.git
69+
- run: pip install -e ./fusion_transport_surrogates
70+
- run: echo "TORAX_QLKNN_MODEL_PATH=$PWD/fusion_transport_surrogates/fusion_transport_surrogates/models/qlknn_7_11.qlknn" >> "$GITHUB_ENV"
71+
7072
- run: pip install -e .[dev]
7173
- run: pip freeze
7274

README.md

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ sudo apt-get install python3-tk
7272

7373
### How to install
7474

75+
#### Prepare a virtual Environment
76+
7577
Install virtualenv (if not already installed):
7678

7779
```shell
@@ -102,24 +104,26 @@ Activate the virtual env:
102104
source toraxvenv/bin/activate
103105
```
104106

105-
Download QLKNN dependencies:
107+
#### Install QLKNN_7_11
106108

107109
```shell
108-
git clone https://gitlab.com/qualikiz-group/qlknn-hyper.git
110+
git clone https://github.com/google-deepmind/fusion_transport_surrogates.git
111+
pip install -e ./fusion_transport_surrogates
112+
export TORAX_QLKNN_MODEL_PATH="$PWD"/fusion_transport_surrogates/fusion_transport_surrogates/models/qlknn_7_11.qlknn
109113
```
110114

111-
```shell
112-
export TORAX_QLKNN_MODEL_PATH="$PWD"/qlknn-hyper
113-
```
114-
115-
It is recommended to automate the environment variable export. For example, if
116-
using bash, run:
115+
We recommend automating the variable export. If using bash, run:
117116

118117
```shell
119-
echo export TORAX_QLKNN_MODEL_PATH="$PWD"/qlknn-hyper >> ~/.bashrc
118+
echo export TORAX_QLKNN_MODEL_PATH="$PWD"/fusion_transport_surrogates/fusion_transport_surrogates/models/qlknn_7_11.qlknn >> ~/.bashrc
120119
```
120+
121121
The above command only needs to be run once on a given system.
122122

123+
An alternative to QLKNN_7_11 is [QLKNN-hyper](#optional-install-qlknn-hyper)
124+
125+
#### Install TORAX
126+
123127
Download and install the TORAX codebase via http:
124128

125129
```shell
@@ -177,8 +181,7 @@ completed.
177181
To run more involved, ITER-inspired simulations, run:
178182

179183
```shell
180-
python3 run_simulation_main.py
181-
--config='torax.examples.iterhybrid_rampup'
184+
python3 run_simulation_main.py --config='torax.examples.iterhybrid_rampup'
182185
```
183186

184187
and
@@ -192,7 +195,7 @@ run command, and environment variables. For example, for increased output
192195
verbosity, can run with the `--log_progress` flag.
193196

194197
```shell
195-
python3 run_simulation_main.py
198+
python3 run_simulation_main.py \
196199
--config='torax.examples.iterhybrid_rampup' --log_progress
197200
```
198201

@@ -285,6 +288,34 @@ You can get out of the Python virtual env by deactivating it:
285288
deactivate
286289
```
287290

291+
#### (Optional) Install QLKNN-hyper
292+
293+
An alternative to QLKNN_7_11 is to use QLKNN-hyper (also known as QLKNN10D)
294+
instead. QLKNN_7_11 was trained on more recent data that includes more
295+
information about impurities, and better coverage of the edge region compared
296+
to QLKNN-hyper. However, it is still widely used in other simulators, so it can
297+
be useful for comparative studies for instance.
298+
299+
Download QLKNN-hyper dependencies:
300+
301+
```shell
302+
git clone https://gitlab.com/qualikiz-group/qlknn-hyper.git
303+
```
304+
305+
Make QLKNN-hyper the default QLKNN model.
306+
307+
```shell
308+
export TORAX_QLKNN_MODEL_PATH="$PWD"/qlknn-hyper
309+
```
310+
311+
It is recommended to automate the environment variable export. For example, if
312+
using bash, run:
313+
314+
```shell
315+
echo export TORAX_QLKNN_MODEL_PATH="$PWD"/qlknn-hyper >> ~/.bashrc
316+
```
317+
The above command only needs to be run once on a given system.
318+
288319
## Simulation tutorials
289320

290321
Under construction
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

torax/tests/test_data/test_eqdsk.nc

538 KB
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
-136 KB
Binary file not shown.

0 commit comments

Comments
 (0)