-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex_gui_reload_model.py
40 lines (26 loc) · 1.31 KB
/
ex_gui_reload_model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
Example of preprocessed spectra model reloading through the application
"""
from pathlib import Path
from fitspy.apps import fitspy_launcher, init_app, end_app
DATA = Path(__file__).parent / "data"
def gui_reload_model(gui='pyside'):
""" Example of preprocessed spectra model reloading through the appli """
fitspy_launcher(fname_json=DATA / 'spectra_2' / 'model.json', gui=gui)
def gui_reload_model_2d_map(gui='pyside'):
""" Example of preprocessed '2D map' spectra model reloading through the appli """
fitspy_launcher(fname_json=DATA / '2D_maps' / 'model.json', gui=gui)
def gui_reload_model_with_data(dirname_res=None, gui='pyside'):
""" Example of preprocessed spectra model + data reloading through the appli """
# fitspy_launcher(fname_json=DATA / 'spectra_2' / 'model_data.json', gui=gui)
# -> to be able to save results in dirname_res for pytest
appli, app = init_app(gui)
appli.reload(fname_json=DATA / 'spectra_2' / 'model_data.json')
end_app(gui, appli, app, dirname_res=dirname_res)
if __name__ == "__main__":
gui_reload_model(gui='pyside')
# gui_reload_model(gui='tkinter')
# gui_reload_model_2d_map(gui='pyside')
# gui_reload_model_2d_map(gui='tkinter')
# gui_reload_model_with_data(gui='pyside')
# gui_reload_model_with_data(gui='tkinter')