Skip to content

Commit c19778d

Browse files
authored
Merge pull request #3 from pabloprf/development
Content ready for first release
2 parents 9a1c5fb + ef3e8d2 commit c19778d

File tree

12 files changed

+119
-42
lines changed

12 files changed

+119
-42
lines changed

config/config_user_example.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,41 @@
1717
"local": {
1818
"machine": "local",
1919
"username": "exampleusername",
20-
"scratch": "/Users/exampleusername/scratch/"
20+
"scratch": "/Users/exampleusername/scratch/",
21+
"modules": ""
2122
},
2223
"engaging": {
2324
"machine": "eofe7.mit.edu",
2425
"username": "exampleusername",
2526
"partition": "sched_mit_psfc",
2627
"identity": "~/.ssh/id_rsa",
27-
"scratch": "/nobackup1/exampleusername/"
28+
"scratch": "/nobackup1/exampleusername/",
29+
"modules": ""
2830
},
2931
"mfews": {
3032
"machine": "mfews02.psfc.mit.edu",
3133
"username": "exampleusername",
3234
"port": 9224,
33-
"scratch": "/home/exampleusername/scratch/"
35+
"scratch": "/home/exampleusername/scratch/",
36+
"modules": ""
3437
},
3538
"mfews_tunneled": {
3639
"machine": "mfews02.psfc.mit.edu",
3740
"username": "exampleusername",
3841
"tunnel": "mferws01.psfc.mit.edu",
3942
"scratch_tunnel": "/home/exampleusername/scratch/",
4043
"port": 9224,
41-
"scratch": "/home/exampleusername/scratch/"
44+
"scratch": "/home/exampleusername/scratch/",
45+
"modules": ""
4246
},
4347
"iris": {
4448
"machine": "irisa.gat.com",
4549
"username": "exampleusername",
4650
"tunnel": "cybele.gat.com",
4751
"scratch_tunnel": "/home/exampleusername/scratch/",
4852
"port": 2039,
49-
"scratch": "/cluster-scratch/exampleusername/"
53+
"scratch": "/cluster-scratch/exampleusername/",
54+
"modules": ""
5055
},
5156
"globus": {
5257
"username": "exampleusername",

docs/_static/css/custom.css

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,32 @@
1919
/* Customize the container of the dropdown */
2020
.sphinx-bs-panels-container {
2121
margin-bottom: 1em;
22-
}
22+
}
23+
24+
img {
25+
transition: transform 0.25s ease;
26+
}
27+
28+
img:hover {
29+
transform: scale(1.05); /* Slightly enlarge the image on hover */
30+
border-color: #555; /* Change border color on hover */
31+
}
32+
33+
img {
34+
border: 2px solid #888; /* Solid grey border */
35+
padding: 5px; /* Space between the image and border */
36+
background-color: white; /* Background color inside the frame */
37+
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2); /* Optional: add shadow for depth */
38+
}
39+
40+
img {
41+
display: inline-block; /* Allows images to sit side by side */
42+
margin-right: 2%; /* Add some space between the images */
43+
vertical-align: top; /* Aligns images to the top */
44+
}
45+
46+
.clearfix::after {
47+
content: "";
48+
display: table;
49+
clear: both;
50+
}

docs/_static/js/open_links_in_new_tab.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,24 @@ window.onload = function() {
33
for (var i = 0; i < anchors.length; i++) {
44
anchors[i].setAttribute('target', '_blank');
55
}
6-
};
6+
};
7+
8+
window.onload = function() {
9+
// Your existing code for external links
10+
var anchors = document.querySelectorAll('a.external');
11+
for (var i = 0; i < anchors.length; i++) {
12+
anchors[i].setAttribute('target', '_blank');
13+
}
14+
15+
// New code for images
16+
var images = document.querySelectorAll('img');
17+
for (var j = 0; j < images.length; j++) {
18+
// Wrapping each image in an anchor tag
19+
var img = images[j];
20+
var link = document.createElement('a');
21+
link.setAttribute('href', img.src);
22+
link.setAttribute('target', '_blank'); // Open in new tab
23+
img.parentNode.insertBefore(link, img);
24+
link.appendChild(img);
25+
}
26+
};
414 KB
Loading
486 KB
Loading

docs/capabilities/tglf_capabilities.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,33 @@ Once setup has been successful, the following regression test should run smoothl
1414
:local:
1515
:depth: 1
1616

17+
Plot TGLF results
18+
-----------------
19+
20+
MITIM provides comprehensive utilities to interpret the results of TGLF simulations.
21+
As will be detailed in :ref:`TGLF aliases`, we can use the ``mitim_plot_tglf`` alias to plot TGLF results that exist in folder ``tglf_run/``:
22+
23+
.. code-block:: bash
24+
25+
mitim_plot_tglf tglf_run/
26+
27+
Running this will open an interactive python session and show a comprehensive notebook with all the relevant TGLF outputs:
28+
29+
.. image:: ./figs/TGLF_plot1.png
30+
:align: left
31+
:width: 46%
32+
33+
.. image:: ./figs/TGLF_plot2.png
34+
:align: left
35+
:width: 46%
36+
37+
.. raw:: html
38+
39+
<br><br>
40+
41+
The results can be accessed from the ``tglf.results`` dictionary.
42+
43+
1744
Run TGLF from input.gacode
1845
--------------------------
1946

docs/conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,14 @@
8888

8989
# Change the tooltip text
9090
copybutton_tooltip_text = "Copy to clipboard"
91+
92+
html_context = {
93+
'images_config': {
94+
'backend': 'LightBox2',
95+
'default_image_width': '50%',
96+
'use_placeholder': True,
97+
'placeholder': 'placeholder.png',
98+
'download': True,
99+
'download_text': 'Download',
100+
},
101+
}

src/mitim_tools/gacode_tools/aux/GACODEinterpret.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,14 @@ def Waveform_read(file, fileOut):
6767
with open(fileOut, "r") as f:
6868
aux = f.readlines()
6969

70-
ky = float(aux[4].split()[-1])
70+
for ir in range(len(aux)):
71+
if "ky:" in aux[ir]: break
72+
73+
74+
ky = float(aux[ir].split()[-1])
7175
g, f = [], []
72-
for i in range(len(aux[6:])):
73-
a = aux[6 + i].split()
76+
for i in range(len(aux[ir+2:])):
77+
a = aux[ir + 2 + i].split()
7478
f.append(float(a[1]))
7579
g.append(float(a[2]))
7680

src/mitim_tools/misc_tools/CONFIGread.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def machineSettings(
7272
forceUsername=None,
7373
):
7474
"""
75-
This script uses the config json file and completes the information required to run each code (like modules, tunnels)
75+
This script uses the config json file and completes the information required to run each code
7676
7777
forceUsername is used to override the json file (for TRANSP PRF), adding also an identity and scratch
7878
"""
@@ -82,7 +82,7 @@ def machineSettings(
8282
machine = s["preferences"][code]
8383

8484
"""
85-
Set-up per code and machine (loading modules, tunnels, etc)
85+
Set-up per code and machine
8686
-------------------------------------------------
8787
"""
8888

@@ -101,14 +101,18 @@ def machineSettings(
101101
"port": None,
102102
"identity": None,
103103
"partition": None,
104-
"modules": "source $MITIM_PATH/config/mitim.bashrc",
104+
"modules": "source $MITIM_PATH/config/mitim.bashrc",
105105
"folderWork": scratch,
106106
"exclude": s[machine]["exclude"] if "exclude" in s[machine] else None,
107107
"isTunnelSameMachine": bool(s[machine]["isTunnelSameMachine"])
108108
if "isTunnelSameMachine" in s[machine]
109109
else False,
110110
}
111111

112+
# I can give extra things to load in the config file
113+
if "modules" in s[machine] and s[machine]["modules"] is not None and s[machine]["modules"] != "":
114+
machineSettings["modules"] = f'{machineSettings["modules"]}\n{s[machine]["modules"]}'
115+
112116
checkers = ["identity", "partition", "tunnel", "port"]
113117
for i in checkers:
114118
if i in s[machine]:
@@ -119,27 +123,12 @@ def machineSettings(
119123
"folderWorkTunnel"
120124
] = f"{s[machine]['scratch_tunnel']}/{nameScratch}"
121125

122-
# ************************************************************************************************************************
123-
# Issues
124-
# ************************************************************************************************************************
125-
126-
# For some reason, going into iris does not know what $MITIM_PATH is even if it's defined in bash... so do this trick until I find a solution:
127-
if machine == "iris":
128-
machineSettings[
129-
"modules"
130-
] = f"source /home/{s[machine]['username']}/MITIM/config/mitim.bashrc"
131-
132126
# ************************************************************************************************************************
133127
# Specific case of being already in the machine where I need to run
134128
# ************************************************************************************************************************
135129

136-
AmIAlreadyHere = (
137-
((machine in ["mfews"]) and ("mfews" in socket.gethostname()))
138-
or ((machine in ["iris"]) and ("iris" in socket.gethostname()))
139-
or ((machine in ["engaging"]) and (isThisEngaging()))
140-
)
141-
142-
if AmIAlreadyHere:
130+
# Am I already in this machine?
131+
if machine in socket.gethostname():
143132
# Avoid tunneling and porting if I'm already there
144133
machineSettings["tunnel"] = machineSettings["port"] = None
145134

src/mitim_tools/misc_tools/FARMINGtools.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,6 @@ def runCommand(
508508
tunnelF = tunnel
509509
machineF = machine
510510

511-
# I RMOVED THIS BECAUSE IT'S DONE IN THE SLURM DEFINITION COMMAND
512-
# if 'modules' in machineSettings and machineSettings['modules'] is not None and len(machineSettings['modules']) >0:
513-
# commandMain = machineSettings['modules'] + ' && ' + commandMain
514-
515511
currentTime = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
516512

517513
print(

0 commit comments

Comments
 (0)