Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
394 commits
Select commit Hold shift + click to select a range
1f99998
Bug fixes maestro after mitimstate transition
pabloprf Aug 6, 2025
1176868
bug fix
pabloprf Aug 6, 2025
b7b6217
maestro plot bug fix
pabloprf Aug 6, 2025
e9bdffa
Moved logger from BO to MAESTRO timings and removal of historical Log…
pabloprf Aug 6, 2025
5c43855
misc
pabloprf Aug 6, 2025
5f08280
Bug fix MAESTRO in new development changes
pabloprf Aug 7, 2025
73baf47
For now, until further fixes, do not require quends or vmecpp
pabloprf Aug 7, 2025
66045a8
Bug fix fast
pabloprf Aug 8, 2025
1919d78
Bug fix MAESTRO gacode_state
pabloprf Aug 8, 2025
1c2015f
Bug fixes MAESTRO in new development
pabloprf Aug 8, 2025
8628af8
misc
pabloprf Aug 8, 2025
f8f4d8f
Bug fixes plot maestro
pabloprf Aug 8, 2025
b51ce94
better maestro plotting timings
pabloprf Aug 8, 2025
cbd2cae
Quick patch so that query_yes_no automatically responds yes if runnin…
AudreySaltzman Aug 13, 2025
48303e8
bug fix remote retrieval same name
pabloprf Aug 18, 2025
f1d2853
misc
pabloprf Aug 19, 2025
ba26164
Adjust patch for interactive response required on slurm system to thr…
AudreySaltzman Aug 20, 2025
db12da5
Fixed bug EPED local
pabloprf Aug 21, 2025
479e277
Removed deprecated options for direct tglf prep
pabloprf Aug 19, 2025
82e6915
direct preparation should use what the input.gacode has
pabloprf Aug 19, 2025
01f8c4c
Removal of deprecated options
pabloprf Aug 19, 2025
daacd0f
Minimal NEO object
pabloprf Aug 19, 2025
c054051
Minimal local neo example running
pabloprf Aug 19, 2025
705e6dc
Generalization of gacode simulation
pabloprf Aug 20, 2025
3bd6548
Generalization applied to NEO as well
pabloprf Aug 20, 2025
95e23af
NEO module fully working
pabloprf Aug 20, 2025
91f1386
PORTALS working fully with standalone TGLF + NEO
pabloprf Aug 20, 2025
0e9c3b0
Solved circular import
pabloprf Aug 20, 2025
2a193b6
Rotation in to_neo working
pabloprf Aug 20, 2025
9957f65
NEO module and portals ready to ship
pabloprf Aug 20, 2025
103a227
misc
pabloprf Aug 20, 2025
795fea3
NEO defaults
pabloprf Aug 21, 2025
4d69a3e
misc
pabloprf Aug 21, 2025
780be5d
changing prep naming and made run_scan general
pabloprf Aug 21, 2025
e9eb771
misc
pabloprf Aug 21, 2025
1c5b176
Generalization of TGLF scans and application to NEO as well
pabloprf Aug 22, 2025
e0c5d6e
subFolderTGLF -> subfolder
pabloprf Aug 22, 2025
6ed6944
Changed default to use standalone TGLF and NEO in PORTALS
pabloprf Aug 22, 2025
b800d5b
Merge pull request #105 from pabloprf/tglfneo
pabloprf Aug 22, 2025
c4af004
Towards a tigher PORTALS-CGYRO coupling
pabloprf Aug 22, 2025
ccab4e7
bug fix, profiles_postprocessing_fun must return the object
pabloprf Aug 22, 2025
ab530b7
Merge branch 'development' of github.com:pabloprf/MITIM-fusion into d…
pabloprf Aug 22, 2025
64e427d
Added secondary criterion for transp finished
pabloprf Aug 22, 2025
2b5e884
Bug fix catch type tglf ion
pabloprf Aug 22, 2025
3cffcd9
Merge branch 'development' of github.com:pabloprf/MITIM-fusion into d…
pabloprf Aug 22, 2025
c862af1
Generalization of code call
pabloprf Aug 22, 2025
b0117f6
misc
pabloprf Aug 22, 2025
47c5fb5
Generalization of read commands and CGYRO as another TGLF/NEO
pabloprf Aug 23, 2025
e4d5b32
Full CGYRO workflow working, inheriting from gacode simulation
pabloprf Aug 23, 2025
77ad435
Towards a PORTALS-CGYRO direct interaction
pabloprf Aug 23, 2025
6717a32
Further generalization of gacodeinput
pabloprf Aug 24, 2025
e94f2f2
GX fully working; missing parallelization and checks about variables
pabloprf Aug 24, 2025
f6a81c5
Nicer GX
pabloprf Aug 24, 2025
5dc3069
Improved GX
pabloprf Aug 25, 2025
6d239f1
Added specification of machine's GPUs
pabloprf Aug 26, 2025
04f62c5
misc GX
pabloprf Aug 26, 2025
f2cff79
Lump all ions
pabloprf Aug 26, 2025
1723391
Implemented json idea for transport models in PORTALS
pabloprf Aug 26, 2025
78cf60b
Better handling of slurm_settings when launching a gacode simulation
pabloprf Aug 26, 2025
db4bb84
Each code handles its own slurm specifications now
pabloprf Aug 26, 2025
b93b497
Adjustments to TGYRO model to follow same process
pabloprf Aug 26, 2025
8daa079
Recover TGYRO way
pabloprf Aug 26, 2025
ee0d75c
Recovered old cgyro way
pabloprf Aug 26, 2025
1f67bc8
Development of new CGYRO model for PORTALS
pabloprf Aug 26, 2025
b4d6244
misc corrections
pabloprf Aug 26, 2025
47d7119
misc fixes
pabloprf Aug 27, 2025
2a330ee
Recovered capability to check and fetch, now for all simulations
pabloprf Aug 27, 2025
714d5e9
Naming changing... moving to simulation_tools
pabloprf Aug 27, 2025
ab14f8b
misc
pabloprf Aug 27, 2025
6e94942
Transitioned to GB json files
pabloprf Aug 27, 2025
4074d9b
cpus per task allocations
pabloprf Aug 27, 2025
5ef8243
Corrected cores
pabloprf Aug 27, 2025
14d4eb1
changed from model_complete to transport_simulation_folder
pabloprf Aug 27, 2025
5ca15b6
SMARTS relevant: Always run base TGLF even if CGYRO selected
pabloprf Aug 27, 2025
884931a
SMARTS relevant: Added PORTALSparameters['only_minimal_files_TGLF']
pabloprf Aug 27, 2025
617fadb
Instead of only_minimal_files_TGLF, use "keep_tglf_files": "base", # …
pabloprf Aug 27, 2025
33f2daa
SMARTS relevant: TGLF base case separated from the drives scan
pabloprf Aug 27, 2025
c981b0a
SMARTS relevant: Whenever a simulation is farmed out, a log file indi…
pabloprf Aug 27, 2025
9bbb954
Bug fix slurm submitter
pabloprf Aug 27, 2025
42cc2c1
bug fix
pabloprf Aug 27, 2025
c9f9bed
First implementation of automatic PORTALS-CGYRO working
pabloprf Aug 27, 2025
366ffd7
bug fix
pabloprf Aug 28, 2025
704859d
Substantial changes to naming convention for portals parameters
pabloprf Aug 28, 2025
bc789e0
Added stable correciton CGYRO and further naming convntions
pabloprf Aug 28, 2025
8ebb90d
Removal of non-kept-up-to-date TGYRO implementation with PORTALS
pabloprf Aug 28, 2025
87bc6af
Allow to provide model to portals as string
pabloprf Aug 28, 2025
993a6c3
Remove deprecated initialization to PORTALS... always do it outside o…
pabloprf Aug 28, 2025
8848bba
Recover the writer of portals profiles
pabloprf Aug 28, 2025
7b9ae82
misc fixes
pabloprf Aug 28, 2025
89ace37
Beautiful new infrastructure for transport model selection
pabloprf Aug 28, 2025
148082a
bug fix
pabloprf Aug 29, 2025
00fb5e9
First implementaiton of PORTALS-GX working
pabloprf Aug 29, 2025
8d9cbb5
TargetType now list of strings
pabloprf Aug 29, 2025
429f4a1
Removal of launchEvaluationsAsSlurmJobs because I let config handle that
pabloprf Aug 29, 2025
1f1b789
Implementation of new portals YAML !!
pabloprf Aug 29, 2025
d349129
bug fix
pabloprf Aug 29, 2025
0ee09a1
askQuestions can be provided to the portals init
pabloprf Aug 29, 2025
2c641c2
askQuestions works for portals prep now
pabloprf Aug 29, 2025
b327dad
nicer yaml
pabloprf Aug 29, 2025
37ef225
MAESTRO working with new portals yml namelist and changes
pabloprf Aug 29, 2025
9bc696a
Allow eped initializer in MAESTRO to be different than the full EPED
pabloprf Aug 29, 2025
5572eb4
code_settings can now receive labels not numbers!
pabloprf Aug 29, 2025
c47450c
Removal of historical additional_params_in_surrogate
pabloprf Aug 29, 2025
e80202c
misc
pabloprf Aug 29, 2025
c5210b2
misc
pabloprf Aug 29, 2025
91f4301
TGLFsettings for most of MITIM is now code_settings
pabloprf Aug 29, 2025
e2a4712
bug fix
pabloprf Aug 29, 2025
c2f6ed6
bug fixes
pabloprf Aug 29, 2025
b6595bf
misc
pabloprf Aug 29, 2025
6bdd664
Removed regressions for now, I will come back to it
pabloprf Aug 29, 2025
05abb66
Corrected maestro template namelist
pabloprf Aug 29, 2025
940d953
Fix location of elif statement for adding eped_initializer from eped …
AudreySaltzman Aug 29, 2025
25339a0
Fix error in last commit
AudreySaltzman Aug 29, 2025
094eb38
Actually saving the file modified in the last commit
AudreySaltzman Aug 29, 2025
452a51b
Fixed bug with TGLF error bars
pabloprf Aug 29, 2025
60b3d95
Wrote functions to write yaml files to keep track
pabloprf Aug 30, 2025
b026412
bug fix
pabloprf Aug 30, 2025
210da3b
misc
pabloprf Aug 30, 2025
934bd0d
Transitioned optimization namelist to YAML
pabloprf Aug 30, 2025
129d93d
Transitioned to yaml for MAESTRO
pabloprf Aug 30, 2025
5d6f88e
Transitioned to yaml for all simulation models
pabloprf Aug 30, 2025
2f70133
Added capability of a simple mitim_run_portals
pabloprf Aug 30, 2025
1c7a549
Transitioned to exploration ranges in YAML, not to prep()
pabloprf Aug 30, 2025
24a58b8
namelist now refers to namelist location of submodules
pabloprf Aug 30, 2025
35a128d
Bug fix: TRANSP requires exclusive node
pabloprf Aug 30, 2025
fadeec8
misc
pabloprf Aug 30, 2025
89e6310
Do not raise TRANSP exclusive warning as a question, since it is not …
pabloprf Aug 31, 2025
57c0b51
Common CGYRO and GX plotting of time traces
pabloprf Sep 1, 2025
3760a8f
Make multipliers also potential lists
pabloprf Sep 1, 2025
eb19b0b
Capability to send additional files, e.g. cgyro and gx
pabloprf Sep 2, 2025
a2de81c
Bug fix
pabloprf Sep 2, 2025
a0fb68a
Common dpdr calculator TGLF GX
pabloprf Sep 3, 2025
f141b5b
bug fix -> fine targets
pabloprf Sep 3, 2025
4e3ef6b
Add job array limit option to EPEDtools.py
Sep 3, 2025
ceac4b3
Add ob_array_limit to EPED_workflow.py as self documentation
Sep 3, 2025
7f05b1b
linear checking for cgyro analysis
jo-hall Sep 4, 2025
617f0ee
misc
pabloprf Sep 4, 2025
a883344
Add ability to use squareness to EPEDtools.py, added pass of removeSc…
Sep 5, 2025
1232a45
Merge branch 'development' of github.com:pabloprf/MITIM-fusion into d…
Sep 5, 2025
4413d51
roa can be list or np.array in CGYRO json writer
pabloprf Sep 5, 2025
146769b
misc defaults
pabloprf Sep 5, 2025
655a89b
Close xr files once done using them to prevent errors - changes sugge…
Sep 5, 2025
98e8246
Merge branch 'development' of github.com:pabloprf/MITIM-fusion into d…
Sep 5, 2025
d5d64f4
pygacode not necessary unless CGYRO
pabloprf Sep 5, 2025
f26b8a1
Add labels to EPED graphs and close the xr to avoid errors
Sep 9, 2025
2ce47d4
Add ability to pass wait to run_slurm
AudreySaltzman Sep 10, 2025
7a1378f
Fix bug where all submisions through run_slurm are called mitim_job, …
AudreySaltzman Sep 10, 2025
b586b22
powerstate to gacode power flows only works with 0 btach for now
pabloprf Sep 11, 2025
9ea3fe2
raise species warning in TGLF only if specie is there
pabloprf Sep 11, 2025
c802434
Do not force threads in pytorch tests
pabloprf Sep 11, 2025
8726b28
Improvements to EPED plot function
AudreySaltzman Sep 15, 2025
aa06f7b
Changing defaults for no-transport model evaluation, generalizable
pabloprf Sep 16, 2025
950d9ee
Fixed folder removal with proper shutil
pabloprf Sep 16, 2025
bc55dfb
bug fix surrogate_selection
pabloprf Sep 16, 2025
e327199
Merge branch 'development' of github.com:pabloprf/MITIM-fusion into d…
pabloprf Sep 16, 2025
6ccf2aa
Corrected bug that read twice the gacode sim folders
pabloprf Sep 17, 2025
5442ebb
Fixed bug CGYRO evaluation in PORTALS
Sep 18, 2025
1b9b683
Fixed bug with remote minimal maestro
nthoward Sep 18, 2025
3b69d78
Fixed bug pathlib remote folders
nthoward Sep 18, 2025
f1ace30
Merge branch 'development' of github.com:pabloprf/MITIM-fusion into d…
pabloprf Sep 18, 2025
4f1531a
Bug fixes linear scan plotting in CGYRO module after SIMtools transition
pabloprf Sep 18, 2025
3bf707e
Some touches to fix cgyro linear scan plotting
pabloprf Sep 18, 2025
8eb61ff
makes sense to enforce density gradients to fast too by default
nthoward Sep 19, 2025
843b995
To avoid potentially overwritting an original input.gacode, rename
pabloprf Sep 19, 2025
4cacd64
Pe/Pi to include fusion too
pabloprf Sep 19, 2025
94abae3
Capability to only retrieve files (cases with connection lost but sim…
pabloprf Sep 21, 2025
7f5f6d6
Common way to read CGYRO ky scans
pabloprf Sep 21, 2025
43dcabd
CGYRO standalone reader now takes prefix for scans
pabloprf Sep 22, 2025
1041dbe
_SCALE_ variables are not recommended as extraOptions
pabloprf Sep 22, 2025
1635db0
When doing PORTALS-CGYRO, also run TGLF depending on namelist flag
pabloprf Sep 22, 2025
5af4521
Fixed bug that prevented to read the optimization_options from the MA…
pabloprf Sep 22, 2025
f96ca9f
MAESTRO defaults should use 30 portals iterations and allow lower exc…
pabloprf Sep 22, 2025
5514f1d
Capability to expand surrogate_data to include other channels
pabloprf Sep 22, 2025
72e5833
Bug fix that prevented PORTALS to use CGYRO's result in prep mode (js…
pabloprf Sep 23, 2025
4d0eee2
Default PORTALS-CGYRO is prep
pabloprf Sep 23, 2025
b699b75
idiot-proofed strange parser error
jo-hall Sep 23, 2025
40d04ef
generalize process_fluctuations for cases without some fields
jo-hall Sep 23, 2025
391bc0e
more generalizations to process fluxes and flucts without EM fields
jo-hall Sep 23, 2025
db2a6be
removed print statement and mixup between moment and field
jo-hall Sep 23, 2025
6942b6d
fixed issue for cases with only apar
jo-hall Sep 23, 2025
c4714b6
added read_cgyro option to save output to pickle
jo-hall Sep 23, 2025
5361e12
don't pickle fluctuation data unless --two is used
jo-hall Sep 23, 2025
9cf9b40
--two should not be required if one wants fluctution information. Pas…
pabloprf Sep 23, 2025
d4ae0d0
MITIMstate: added mass weighted velocity profiles when lumping species
gsnoep Sep 24, 2025
bb6bd1c
name pickle file descriptively
jo-hall Sep 24, 2025
53c1ae7
added initial retrieval function
jo-hall Sep 24, 2025
5b16789
yet another parser issue on cosmos :(
jo-hall Sep 24, 2025
8f7d190
more parser errors yay sorry
jo-hall Sep 24, 2025
ee5167f
correct location for pickle output
jo-hall Sep 24, 2025
2d46291
working remote pickling and retrieval function for CGYRO!
jo-hall Sep 24, 2025
5cfaafd
MITIMstate: bugfix key check in moveSpecie()
gsnoep Sep 24, 2025
33f0160
Back to \"$folder\"' until further notice
pabloprf Sep 24, 2025
90a174a
Plot L-mode functionals
pabloprf Sep 26, 2025
a29f617
Do not force the user to install onnx2pytorch, not required
pabloprf Sep 29, 2025
63d0ca2
Problematic folder quotes fixed
pabloprf Sep 29, 2025
29bb0e5
GIve full location of farming errors
pabloprf Sep 29, 2025
9836fb2
Bug fix quotes portals beat
pabloprf Sep 29, 2025
b8f3f4e
Various double quotes bug fixes
pabloprf Sep 29, 2025
fc1aded
oops, missed it...
pabloprf Sep 29, 2025
d6ee446
And... once again... sorry
pabloprf Sep 29, 2025
d779f90
PORTALS debugger with standalone and scans of TGLF now is one tool
pabloprf Sep 30, 2025
1f487da
Comparing namelists now organizes values per relative differences
pabloprf Sep 30, 2025
bb7dbef
Fixed TGLF grabber in new portals namelist
pabloprf Sep 30, 2025
c460c02
Extract postprocessing of MAESTRO-PORTALS such that it can be part of…
pabloprf Sep 30, 2025
4de7e76
Bug fix of str vs int in variables
pabloprf Sep 30, 2025
ee1c84f
[Experimental feature] Implementation of "ball" idea to reuse of TGLF…
pabloprf Oct 1, 2025
2e38d28
Bug fix PORTALS
pabloprf Oct 1, 2025
6bac693
Cleaned up ball_workflow for more descriptive prints
pabloprf Oct 1, 2025
0907212
GX should be, by default, only prepared, for now
Oct 1, 2025
6a4bb01
Do not raise warnings about GPUs if I'm only preparing GX inputs, not…
Oct 1, 2025
93e2986
pyproject: added megpy as dependency
gsnoep Oct 1, 2025
c81e0fd
mitim_tools: updated gs_tools/GEQtools to use megpy equilibrium proce…
gsnoep Oct 1, 2025
1086453
mitim_tools: changed gs_tools/utils/GEQplotting to use megpy values
gsnoep Oct 1, 2025
6f79922
fixed write_json_CGYRO by converting np objects to native python objects
Oct 1, 2025
a6dfb3e
Merge branch 'development' of github.com:pabloprf/MITIM-fusion into d…
Oct 1, 2025
d431819
Only check for stable criterion if exists
pabloprf Oct 1, 2025
863f0d3
Added vertical lines for fG in RAPIDS
pabloprf Oct 1, 2025
ab86cf5
Removal of omfit_classes dependency, megpy as substitute geqdsk reader
pabloprf Oct 1, 2025
752537d
pyproject: changed megpy dependency to unstable
gsnoep Oct 2, 2025
d6b6816
Add fibe but not implemented yet
pabloprf Oct 3, 2025
8ae98c5
Do not crash geqdsk crashing if no limiters
pabloprf Oct 3, 2025
403780f
MITIMstate: filter out species with close to zero vtor profiles in ma…
gsnoep Oct 3, 2025
61dd358
Bug fix: NEO now properly searches for electron index in output files
pabloprf Oct 3, 2025
6fce8c0
Bring back omfit_classes until megpy is ready to handle freegs equili…
pabloprf Oct 3, 2025
5ad7e67
New megpy implementations as separate files for now
pabloprf Oct 3, 2025
8a7b968
megpy as the main GEQ, leaving omfit_classes as the old
pabloprf Oct 8, 2025
b23f7fb
Removed omfit classes
pabloprf Oct 8, 2025
b9990b0
kappa aeral must be always positive, regardless of sign of psi
pabloprf Oct 8, 2025
6c20cf2
Until implementation is ready, do not require the new packages
pabloprf Oct 3, 2025
c74bdac
Adding flag to choose whether EPEDbeat uses squareness
AudreySaltzman Oct 6, 2025
229ef9d
Do not plot fast gradients in standard plot by default, pass a color …
pabloprf Oct 8, 2025
7c26719
Bring bach megpy dependency
pabloprf Oct 8, 2025
8410158
Bug fix for EPEDbeat with squareness
AudreySaltzman Oct 8, 2025
eaa3f85
MAESTROplot: updated plot_g_quantities() to be compatible with megpy …
gsnoep Oct 8, 2025
a678440
Bug fix MAESTRO: make _to_mxh routine work even if flux surface is on…
pabloprf Oct 8, 2025
9a91daf
Bug fix: FSA of Bt^2 and Bp^2 were swapped; and their calculation mis…
pabloprf Oct 9, 2025
fdf330f
Make the real frequency not normalized to ky
AudreySaltzman Oct 10, 2025
04ef2c6
Added FiBE equilibrium initialization method
aaronkho Oct 10, 2025
30535b0
Re-added FiBE installation dependency
aaronkho Oct 10, 2025
122a597
Switched fibe dependency to main branch due to merge
aaronkho Oct 10, 2025
8d5ad5e
Bug fix to run MAESTRObeat.py, uneven )
AudreySaltzman Oct 10, 2025
476bdab
Logic of keep_files had weird wording, now fixed to avoid user confusion
pabloprf Oct 11, 2025
438d9b5
Adjustments to make FIBE initializer work with MAESTRO
AudreySaltzman Oct 15, 2025
85e6a24
Merge pull request #108 from pabloprf/fibe_integration
aaronkho Oct 15, 2025
29938a5
Fix for pathlib compatibility
AudreySaltzman Oct 15, 2025
10949cc
Updated megpy and fibe requirements to PyPI versions
aaronkho Oct 15, 2025
8fe2b51
Recover VITALS (after documentation followup)
pabloprf Oct 15, 2025
77febf2
Additional folder expansions for robustness (after documentation foll…
pabloprf Oct 15, 2025
5573f86
Updated documentation
pabloprf Oct 15, 2025
d602b66
Removed deprecated TGLF instructions
pabloprf Oct 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/scratch/*
*.DS_Store*
config_user.json
.DS_Store
*.egg-info/
docs/build/
*.bat
Expand Down
4 changes: 2 additions & 2 deletions docs/capabilities/misc_capabilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Miscellaneous
Interpret Tokamak equilibrium
-----------------------------

MITIM has a quick g-eqdsk file reader and visualizer that is based on the ``omfit-classes`` package.
MITIM has a quick g-eqdsk file reader and visualizer that is based on the ``megpy`` package.

To open and plot a g-eqdsk file:

Expand Down Expand Up @@ -47,7 +47,7 @@ To open and plot an ``input.gacode`` file:
.. code-block:: python

from mitim_tools.gacode_tools import PROFILEStools
p = PROFILEStools.PROFILES_GACODE(file)
p = PROFILEStools.gacode_state(file)
p.plot()

It will plot results in a notebook-like plot with different tabs:
Expand Down
6 changes: 3 additions & 3 deletions docs/capabilities/optimization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Select the location of the MITIM namelist (see :ref:`Understanding the MITIM nam
.. code-block:: python

folder = Path('MITIM-fusion/tests/scratch/mitim_tut')
namelist = Path('MITIM-fusion/templates/main.namelist.json')
namelist = Path('MITIM-fusion/templates/namelist.optimization.yaml')

Then create your custom optimization object as a child of the parent ``STRATEGYtools.opt_evaluator`` class.
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.
Expand Down Expand Up @@ -105,7 +105,7 @@ Now we can create and launch the MITIM optimization process from the beginning (

.. code-block:: python

MITIM_BO = STRATEGYtools.MITIM_BO( opt_fun1D, cold_startYN = True )
MITIM_BO = STRATEGYtools.MITIM_BO( opt_fun1D, cold_start = True )
MITIM_BO.run()

Once finished, we can plot the results easily with:
Expand All @@ -118,7 +118,7 @@ Once finished, we can plot the results easily with:
Understanding the MITIM namelist
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Checkout file ``MITIM-fusion/templates/main.namelist.json``, which has comprehensive comments.
Checkout file ``MITIM-fusion/templates/namelist.optimization.yaml``, which has comprehensive comments.

*Under development*

Expand Down
57 changes: 18 additions & 39 deletions docs/capabilities/tglf_capabilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,31 @@ To generate the input files (input.tglf) to TGLF at each radial location, MITIM

.. code-block:: python

cdf = tglf.prep(folder,inputgacode=inputgacode_file,cold_start=False )
_ = tglf.prep(inputgacode_file,folder,cold_start=False)

.. tip::

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.
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.

The set of control inputs to TGLF (saturation rule, electromagnetic effects, basis functions, etc.) are provided following the following sequential logic:

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.
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``.
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.

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.
The set of control inputs to TGLF (like saturation rule, electromagnetic effects, etc.) are provided in two ways.
First, the argument ``TGLFsettings`` indicates the base case to start with.
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.
Second, the argument ``extraOptions`` can be passed as a dictionary of variables to change.
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):

.. code-block:: python

tglf.run( subFolderTGLF = 'yes_em_folder',
TGLFsettings = 5,
extraOptions = {},
tglf.run( subfolder = 'yes_em_folder',
code_settings = 'SAT2',
extraOptions = {'USE_BPER':True},
cold_start = False )

tglf.read( label = 'yes_em' )

tglf.run( subFolderTGLF = 'no_em_folder',
TGLFsettings = 5,
tglf.run( subfolder = 'no_em_folder',
code_settings = 'SAT2',
extraOptions = {'USE_BPER':False},
cold_start = False )

Expand Down Expand Up @@ -139,7 +140,7 @@ Similarly as in the previous section, you need to run the ``prep()`` command, bu

.. code-block:: python

cdf = tglf.prep(folder,cold_start=False)
cdf = tglf.prep_using_tgyro(folder,cold_start=False)

.. note::

Expand Down Expand Up @@ -168,7 +169,7 @@ If you have a input.tglf file already, you can still use this script to run it.
inputtglf_file = Path('MITIM-fusion/tests/data/input.tglf')

tglf = TGLFtools.TGLF()
tglf.prep_from_tglf( folder, inputtglf_file, input_gacode = inputgacode_file )
tglf.prep_from_file( folder, inputtglf_file, input_gacode = inputgacode_file )

The rest of the workflow is identical, including ``.run()``, ``.read()`` and ``.plot()``.

Expand All @@ -190,7 +191,7 @@ The rest of the workflow is identical, including ``.run()``, ``.read()`` and ``.
inputtglf_file = Path('MITIM-fusion/tests/data/input.tglf')

tglf = TGLFtools.TGLF()
tglf.prep_from_tglf( folder, inputtglf_file )
tglf.prep_from_file( folder, inputtglf_file )
tglf.read (folder = f'{folder}/', label = 'yes_em' )
tglf.plot( labels = ['yes_em'] )

Expand All @@ -215,26 +216,4 @@ Run 1D scans of TGLF input parameter
TGLF aliases
------------

MITIM provides a few useful aliases, including for the TGLF tools:

- To plot results that exist in a folder ``run1/``, with or without a suffix and with or without an input.gacode file (for normalizations):

.. code-block:: bash

mitim_plot_tglf run1/
mitim_plot_tglf run1/ --suffix _0.55 --gacode input.gacode


- To run TGLF in a folder ``run1/`` using input file ``input.tglf``, with or without an input.gacode file (for normalizations):

.. code-block:: bash

mitim_run_tglf --folder run1/ --tglf input.tglf
mitim_run_tglf --folder run1/ --tglf input.tglf --gacode input.gacode

- To run a parameter scan in a folder ``scan1/`` using input file ``input.tglf``, with or without an input.gacode file (for normalizations):

.. code-block:: bash

mitim_run_tglf --folder scan1/ --tglf input.tglf --gacode input.gacode --scan RLTS_2

MITIM provides a few useful aliases, including for the TGLF tools: :ref:`Shell Scripts`
14 changes: 4 additions & 10 deletions docs/capabilities/tgyro_capabilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Create a PROFILES class from the input.gacode file:

.. code-block:: python

profiles = PROFILEStools.PROFILES_GACODE(gacode_file)
profiles = PROFILEStools.gacode_state(gacode_file)

.. tip::

Expand Down Expand Up @@ -83,7 +83,7 @@ Now TGYRO can be run:
PredictionSet = PredictionSet,
TGLFsettings = TGLFsettings,
TGYRO_solver_options = solver,
Physics_options = physics_options)
TGYRO_physics_options = physics_options)

Read:

Expand Down Expand Up @@ -120,7 +120,7 @@ Create a profiles class with the `input.gacode` file that TGYRO used to run and
gacode_file = Path('MITIM-fusion/tests/data/input.gacode')
folder = Path('MITIM-fusion/tests/scratch/tgyro_tut/run1')

profiles = PROFILEStools.PROFILES_GACODE(gacode_file)
profiles = PROFILEStools.gacode_state(gacode_file)
tgyro_out = TGYROtools.TGYROoutput(folder,profiles=profiles)

Plot results:
Expand All @@ -133,11 +133,5 @@ Plot results:
TGYRO aliases
-------------

MITIM provides a few useful aliases, including for the TGYRO tools:

- To plot results that exist in a folder ``run1/``:

.. code-block:: bash

mitim_plot_tgyro run1/
MITIM provides a few useful aliases, including for the TGYRO tools: :ref:`Shell Scripts`

21 changes: 1 addition & 20 deletions docs/capabilities/transp_capabilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,5 @@ If TRANSP has already been run and the .CDF results file already exists (``cdf_f
TRANSP aliases
--------------

MITIM provides a few useful aliases, including for the TRANSP tools:

- To read TRANSP results in CDF files (which stores the results in the ``cdfs`` list. First run can be plotted with ``cdfs[0].plot``):

.. code-block:: bash

mitim_read_transp 12345A01.CDF 12345A02.CDF

- To interact with the TRANSP globus grid:

.. code-block:: bash

# To check status of runs under username pablorf
mitim_trcheck pablorf

# To remove from the grid CMOD run numbers 88664P01, 88664P03 from user pablorf
mitim_trclean 88664P CMOD --numbers 1,3

# To get results file (intermediate or final) from CMOD run 152895P01 from user pablorf
mitim_trlook 152895P01 CMOD
MITIM provides a few useful aliases, including for the TRANSP tools: :ref:`Shell Scripts`

6 changes: 3 additions & 3 deletions docs/capabilities/vitals_capabilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ As a starting point of VITALS, you need to prepare and run TGLF for the base cas
rho = 0.5

tglf = TGLFtools.TGLF( rhos = [ rho ] )
cdf = tglf.prep( folder, inputgacode = inputgacode_file)
tglf.run( subFolderTGLF = 'run_base', TGLFsettings = 5)
cdf = tglf.prep( inputgacode_file, folder )
tglf.run( subfolder = 'run_base', code_settings = 'SAT3')
tglf.read( label = 'run_base' )


Expand Down Expand Up @@ -120,7 +120,7 @@ Once the VITALS object has been created, parameters such as the TGLF control inp

.. code-block:: python

vitals_fun.TGLFparameters['TGLFsettings'] = 5
vitals_fun.TGLFparameters['code_settings'] = 'SAT3'
vitals_fun.TGLFparameters['extraOptions'] = {}

.. note::
Expand Down
8 changes: 1 addition & 7 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Issues during MITIM installation

.. code-block:: console

pip3 install -e MITIM-fusion\[pyqt\] --no-cache
pip3 install -e MITIM-fusion\[pyqt\] --no-cache-dir

Issues during MITIM tests
-------------------------
Expand Down Expand Up @@ -61,9 +61,3 @@ Issues during MITIM tests

Make sure you that, if you have keys, you have added them to authorized_keys in both server and tunnel machines.



Issues during PORTALS simulations
---------------------------------

Nothing here yet.
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
MITIM: a toolbox for modeling tasks in plasma physics and fusion energy
=======================================================================

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.
Developed in 2018 by `Pablo Rodriguez-Fernandez <https://www.pablorf.com/>`_ at the MIT Plasma Science and Fusion Center, this light-weight, command-line,
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.
Spearheaded by `Pablo Rodriguez-Fernandez <https://www.pablorf.com/>`_ at the MIT Plasma Science and Fusion Center, this light-weight, command-line,
object-oriented toolbox streamlines the execution and interpretation of physics models and simplifies complex optimization tasks.

MITIM stands out for its modular nature, making it particularly useful for integrating models with optimization workflows.
Expand All @@ -28,7 +28,7 @@ Overview
--------

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*).
This evolution marks a significant enhancement in our approach to transport and optimization in plasma physics research.
This evolution marked a significant enhancement in our approach to transport and optimization in plasma physics research.

MITIM's core functionality revolves around the standalone execution of codes and the nuanced interpretation of results through object-oriented Python scripts.
This enables researchers to seamlessly integrate these scripts into custom surrogate-based optimization frameworks,
Expand Down
46 changes: 27 additions & 19 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ Use ``pip`` to install all the required MITIM requirements:
The optional argument ``[pyqt]`` added in the intallation command above must only be used if the machine allows for graphic interfaces.
If running in a computing cluster, remove that flag.
The ``pyqt`` package is used to create condensed figures into a single notebook when interpreting and plotting simulation results.

If you wish to install all capabilities (including compatibility with `OMFIT <https://omfit.io/>`_), it is recommended that ``pip`` is run as follows:

.. code-block:: console

pip3 install -e MITIM-fusion[pyqt,omfit]


If you were unsuccessful in the installation, check out our :ref:`Frequently Asked Questions` section.

Expand All @@ -53,11 +46,11 @@ User configuration
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.
There are also options to specify the default verbose level and the default DPI for the figures in notebooks.
Users need to specify their own configurations in a file that follows the same structure.
There are different options to handle this config file.
There are different options to handle this config file:

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.
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.
3. Create a new file anywhere in your machine. **Do this at the beginning of your script**:
3. Create a new file anywhere in your machine. Then, **add these lines at the beginning of your script**:

.. code-block:: python

Expand Down Expand Up @@ -87,29 +80,46 @@ In this example, the ``identity`` option is only required if you are running in
{
"preferences": {
"tglf": "engaging",
"neo": "local",
"tgyro": "perlmutter",
"verbose_level": "5",
"dpi_notebook": "80"
},
"local": {
"machine": "local",
"username": "YOUR_USERNAME",
"scratch": "/Users/YOUR_USERNAME/scratch/",
"modules": "",
"cores_per_node": 8,
"gpus_per_node": 0
},
"engaging": {
"machine": "eofe7.mit.edu",
"username": "YOUR_USERNAME",
"scratch": "/pool001/YOUR_USERNAME/scratch/",
"modules": "",
"cores_per_node": 64,
"gpus_per_node": 0,
"slurm": {
"partition": "sched_mit_psfc",
"exclusive": false,
"exclude": "node584"
}
},
"perlmutter": {
"machine": "perlmutter.nersc.gov",
"username": "YOUR_USERNAME",
"scratch": "/pscratch/sd/p/YOUR_USERNAME/scratch/",
"modules": "",
"identity": "/Users/YOUR_USERNAME/.ssh/id_rsa_nersc",
"cores_per_node": 32,
"gpus_per_node": 4,
"slurm": {
"account": "YOUR_ACCOUNT",
"partition": "YOUR_PARTITION",
"constraint": "gpu",
"mem": "4GB"
"mem": "4GB",
"email": "optional@email"
}
}
}
Expand All @@ -119,20 +129,15 @@ MITIM will attempt to create SSH and SFTP connections to that machine, and will

.. attention::

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.
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.

Please note that MITIM will try to run the codes with standard commands that the shell must understand.
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.
There are several ways to make sure that the shell understands the command:

.. dropdown:: 1. Source at shell initialization (recommended)
.. dropdown:: 1. Send specific commands per code (recommended)

Is the commands are available upon login in that machine (e.g. in your personal ``.bashrc`` file), MITIM will be able to run them.
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.

.. dropdown:: 2. Send specific commands per code

Finally, you can populate the ``modules`` option per machine in your ``config_user.json`` file. For example:
You can populate the ``modules`` option per machine in your ``config_user.json`` file. For example:

.. code-block:: console

Expand All @@ -142,10 +147,13 @@ There are several ways to make sure that the shell understands the command:
...
}


Note that you can the same machine listed several times in your ``config_user.json`` file, with different ``modules`` options per code.
You just need to give it a different name per code.

.. dropdown:: 2. Source at shell initialization

If the commands are available upon login in that machine (e.g. in your personal ``.bashrc`` file), MITIM will be able to run them.
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.


License and contributions
Expand Down
Loading