You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then create your custom optimization object as a child of the parent ``STRATEGYtools.opt_evaluator`` class.
50
50
You only need to modify what operations need to occur inside the ``run()`` (where operations/simulations happen) and ``scalarized_objective()`` (to define what is the target to maximize) methods.
@@ -105,7 +105,7 @@ Now we can create and launch the MITIM optimization process from the beginning (
The ``.prep()`` method, when applied to a case that starts with an input.gacode file, launches a `TGYRO` run for a "zero" iteration to generate *input.tglf* at specific ``rho`` locations from the *input.gacode*. This method to generate input files is inspired by how the `OMFIT framework <https://omfit.io/index.html>`_ works.
74
+
Now, we are ready to run TGLF. Once the ``prep()`` command has finished, one can run TGLF with different settings and assumptions.
75
+
That is why, at this point, a sub-folder name for this specific run can be provided. Similarly to the ``prep()`` command, a ``cold_start`` flag can be provided.
76
+
77
+
The set of control inputs to TGLF (saturation rule, electromagnetic effects, basis functions, etc.) are provided following the following sequential logic:
78
+
79
+
1. Each code has a set of default settings, which for TGLF are specified in ``templates/input.tglf.controls``. This is the base namelist of settings that will be used if no other specification is provided.
80
+
2. Then, a ``code_settings`` argument can be provided to the ``run()`` command. This argument refers to a specific set of settings that are specified in ``templates/input.tglf.models.yaml``, and that will overwrite the default settings in ``input.tglf.controls``.
81
+
3. Finally, an ``extraOptions`` argument can be provided to the ``run()`` command, which is a dictionary of specific settings to change from the previous two steps.
76
82
77
-
Now, we are ready to run TGLF. Once the ``prep()`` command has finished, one can run TGLF with different settings and assumptions. That is why, at this point, a sub-folder name for this specific run can be provided. Similarly to the ``prep()`` command, a ``cold_start`` flag can be provided.
78
-
The set of control inputs to TGLF (like saturation rule, electromagnetic effects, etc.) are provided in two ways.
79
-
First, the argument ``TGLFsettings`` indicates the base case to start with.
80
-
The user is referred to ``templates/input.tglf.models.json`` to understand the meaning of each setting, and ``templates/input.tglf.controls`` for the default setup.
81
-
Second, the argument ``extraOptions`` can be passed as a dictionary of variables to change.
82
83
For example, the following two commands will run TGLF with saturation rule number 2 with and without electromagnetic effets. After each ``run()`` command, a ``read()`` is needed, to populate the *tglf.results* dictionary with the TGLF outputs (``label`` refers to the dictionary key for each run):
83
84
84
85
.. code-block:: python
85
86
86
-
tglf.run( subFolderTGLF='yes_em_folder',
87
-
TGLFsettings=5,
88
-
extraOptions= {},
87
+
tglf.run( subfolder='yes_em_folder',
88
+
code_settings='SAT2',
89
+
extraOptions= {'USE_BPER':True},
89
90
cold_start=False )
90
91
91
92
tglf.read( label='yes_em' )
92
93
93
-
tglf.run( subFolderTGLF='no_em_folder',
94
-
TGLFsettings=5,
94
+
tglf.run( subfolder='no_em_folder',
95
+
code_settings='SAT2',
95
96
extraOptions= {'USE_BPER':False},
96
97
cold_start=False )
97
98
@@ -139,7 +140,7 @@ Similarly as in the previous section, you need to run the ``prep()`` command, bu
The **MITIM** (MIT Integrated Modeling) is a versatile and user-friendly Python library designed for *plasma physics* and *fusion energy* researchers, distributed as the `MITIM-fusion <https://github.com/pabloprf/MITIM-fusion>`_ GitHub repository.
5
-
Developed in 2018 by `Pablo Rodriguez-Fernandez <https://www.pablorf.com/>`_ at the MIT Plasma Science and Fusion Center, this light-weight, command-line,
4
+
The **MITIM** (MIT Integrated Modeling) is a versatile and user-friendly Python library designed for plasma physics and fusion energy researchers, distributed as the `MITIM-fusion <https://github.com/pabloprf/MITIM-fusion>`_ GitHub repository.
5
+
Spearheaded by `Pablo Rodriguez-Fernandez <https://www.pablorf.com/>`_ at the MIT Plasma Science and Fusion Center, this light-weight, command-line,
6
6
object-oriented toolbox streamlines the execution and interpretation of physics models and simplifies complex optimization tasks.
7
7
8
8
MITIM stands out for its modular nature, making it particularly useful for integrating models with optimization workflows.
@@ -28,7 +28,7 @@ Overview
28
28
--------
29
29
30
30
Developed at the MIT Plasma Science and Fusion Center, MITIM emerged in 2023 as a progression from the PORTALS project (*Performance Optimization of Reactors via Training of Active Learning Surrogates*).
31
-
This evolution marks a significant enhancement in our approach to transport and optimization in plasma physics research.
31
+
This evolution marked a significant enhancement in our approach to transport and optimization in plasma physics research.
32
32
33
33
MITIM's core functionality revolves around the standalone execution of codes and the nuanced interpretation of results through object-oriented Python scripts.
34
34
This enables researchers to seamlessly integrate these scripts into custom surrogate-based optimization frameworks,
Copy file name to clipboardExpand all lines: docs/installation.rst
+27-19Lines changed: 27 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,13 +36,6 @@ Use ``pip`` to install all the required MITIM requirements:
36
36
The optional argument ``[pyqt]`` added in the intallation command above must only be used if the machine allows for graphic interfaces.
37
37
If running in a computing cluster, remove that flag.
38
38
The ``pyqt`` package is used to create condensed figures into a single notebook when interpreting and plotting simulation results.
39
-
40
-
If you wish to install all capabilities (including compatibility with `OMFIT <https://omfit.io/>`_), it is recommended that ``pip`` is run as follows:
41
-
42
-
.. code-block:: console
43
-
44
-
pip3 install -e MITIM-fusion[pyqt,omfit]
45
-
46
39
47
40
If you were unsuccessful in the installation, check out our :ref:`Frequently Asked Questions` section.
48
41
@@ -53,11 +46,11 @@ User configuration
53
46
In ``MITIM-fusion/templates/``, there is a ``config_user_example.json`` with specifications of where to run certain codes and what the login requirements are.
54
47
There are also options to specify the default verbose level and the default DPI for the figures in notebooks.
55
48
Users need to specify their own configurations in a file that follows the same structure.
56
-
There are different options to handle this config file.
49
+
There are different options to handle this config file:
57
50
58
51
1. Create a new file named ``config_user.json`` **in the same folder** ``MITIM-fusion/templates/``. MITIM will automatically look for this file when running the code.
59
52
2. Create a new file anywhere in your machine. Then, **set the environment variable** ``MITIM_CONFIG`` to the path of this file. MITIM will automatically look for this file when running the code.
60
-
3. Create a new file anywhere in your machine. **Do this at the beginning of your script**:
53
+
3. Create a new file anywhere in your machine. Then, **add these lines at the beginning of your script**:
61
54
62
55
.. code-block:: python
63
56
@@ -87,29 +80,46 @@ In this example, the ``identity`` option is only required if you are running in
@@ -119,20 +129,15 @@ MITIM will attempt to create SSH and SFTP connections to that machine, and will
119
129
120
130
.. attention::
121
131
122
-
Note that MITIM does not maintain or develop the simulation codes that are used within it, such as those from `GACODE <http://gafusion.github.io/doc/index.html>`_ or `TRANSP <hhttps://transp.pppl.gov/index.html>`_. It assumes that proper permissions have been obtained and that working versions of those codes exist in the machine configured to run them.
132
+
Note that MITIM does not maintain or develop the simulation codes that are used within it, such as those from `GACODE <https://gacode.io/>`_ or `TRANSP <https://transp.pppl.gov/index.html>`_. It assumes that proper permissions have been obtained and that working versions of those codes exist in the machine configured to run them.
123
133
124
134
Please note that MITIM will try to run the codes with standard commands that the shell must understand.
125
135
For example, to run the TGLF code, MITIM will want to execute the command ``tglf`` in the *eofe7.mit.edu* machine as specified in the example above.
126
136
There are several ways to make sure that the shell understands the command:
127
137
128
-
.. dropdown:: 1. Source at shell initialization (recommended)
138
+
.. dropdown:: 1. Send specific commands per code (recommended)
129
139
130
-
Is the commands are available upon login in that machine (e.g. in your personal ``.bashrc`` file), MITIM will be able to run them.
131
-
Please note that aliases are usually not available in non-interactive shells, and it is recommended to use full paths and to avoid print (echo) statements.
132
-
133
-
.. dropdown:: 2. Send specific commands per code
134
-
135
-
Finally, you can populate the ``modules`` option per machine in your ``config_user.json`` file. For example:
140
+
You can populate the ``modules`` option per machine in your ``config_user.json`` file. For example:
136
141
137
142
.. code-block:: console
138
143
@@ -142,10 +147,13 @@ There are several ways to make sure that the shell understands the command:
142
147
...
143
148
}
144
149
145
-
146
150
Note that you can the same machine listed several times in your ``config_user.json`` file, with different ``modules`` options per code.
147
151
You just need to give it a different name per code.
148
152
153
+
.. dropdown:: 2. Source at shell initialization
154
+
155
+
If the commands are available upon login in that machine (e.g. in your personal ``.bashrc`` file), MITIM will be able to run them.
156
+
Please note that aliases are usually not available in non-interactive shells, and it is recommended to use full paths and to avoid print (echo) statements.
0 commit comments