relap-py 0.0.38__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
relap_py/__init__.py ADDED
@@ -0,0 +1,37 @@
1
+ from .main import (
2
+ relapwin_loc,
3
+ path_to_exe,
4
+ make_strip,
5
+ read_variables,
6
+ read_stripf_df,
7
+ read_stripf,
8
+ run_strip,
9
+ extract_data,
10
+ extract_df,
11
+ plot_var,
12
+ plot_all,
13
+ plot,
14
+ general_fig,
15
+ plot_variables,
16
+ append_variable,
17
+ read_exp,
18
+ print_ss,
19
+ mypie
20
+ )
21
+ from .config import (
22
+ path_to_exe,
23
+ set_path_to_exe,
24
+ relapwin_loc,
25
+ set_relapwin_loc,
26
+ set_figures_type,
27
+ figures_type,
28
+ set_figures_loc,
29
+ figures_loc,
30
+ set_show_plot,
31
+ show_plot,
32
+ set_relap_scdap,
33
+ relap_scdap,
34
+ set_unc_bands,
35
+ unc_bands
36
+ )
37
+
relap_py/config.py ADDED
@@ -0,0 +1,83 @@
1
+ """
2
+ Title: Configuration options
3
+ Date: 30/10/2024
4
+ Created by: Jordi Freixa
5
+ Description:
6
+ """
7
+ import os
8
+
9
+
10
+ def_path_to_exe = os.getenv('RELAP_EXE_PATH')
11
+ if def_path_to_exe is None:
12
+ raise ValueError("Path to the RELAP executable is not set. Set the environment variable RELAP_EXE_PATH.")
13
+
14
+ def_relapwin_loc = os.path.dirname(def_path_to_exe)
15
+
16
+ def path_to_exe():
17
+ return def_path_to_exe
18
+ def relapwin_loc():
19
+ return def_relapwin_loc
20
+
21
+ def set_path_to_exe(new: str):
22
+ global def_path_to_exe
23
+ def_path_to_exe = new
24
+ def set_relapwin_loc(new: str):
25
+ global def_relapwin_loc
26
+ def_relapwin_loc = new
27
+
28
+ """
29
+ Defaults
30
+ :figures_type: (otional) figures format: pdf or png
31
+ :figures_loc: (optional) location where the figures will be saved
32
+ :show_plot: (optional) show interactive python plot window?
33
+ :exp_file_bool: (optional) is there a experimental file?
34
+ :unc_bands: (optional) is there a uncertainty file?
35
+ """
36
+ def_figures_type = 'png'
37
+ def_figures_loc = './'
38
+ def_show_plot = False
39
+ def_unc_bands = False
40
+ def_relap_scdap = False
41
+ """
42
+ Getter and setter functions so the user can change the defaults on the go
43
+
44
+ Getter
45
+ """
46
+
47
+ def figures_type():
48
+ return def_figures_type
49
+ def figures_loc():
50
+ return def_figures_loc
51
+ def show_plot():
52
+ return def_show_plot
53
+ def unc_bands():
54
+ return def_unc_bands
55
+ def relap_scdap():
56
+ return def_relap_scdap
57
+
58
+ """
59
+ Setter
60
+ """
61
+ def set_figures_type(new: str):
62
+ global def_figures_type
63
+ def_figures_type = new
64
+ def set_figures_loc(new: str):
65
+ global def_figures_loc
66
+ def_figures_loc = new
67
+ try :
68
+ os.mkdir(new)
69
+ except OSError :
70
+ print(30*'-'+'WARNING'+30*'-')
71
+ print(' directory ' + new + ' already present')
72
+ print(67*'-')
73
+ def set_show_plot(new: bool):
74
+ global def_show_plot
75
+ def_show_plot = new
76
+ def set_unc_bands(new: str):
77
+ global def_unc_bands
78
+ def_unc_bands = new
79
+ def set_relap_scdap(new: str):
80
+ global def_relap_scdap
81
+ def_relap_scdap = new
82
+
83
+