mg-pso-gui 0.2.75__py3-none-any.whl → 0.2.76__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mg-pso-gui
3
- Version: 0.2.75
3
+ Version: 0.2.76
4
4
  Summary: GUI for MG-PSO
5
5
  Author: Robert Cordingly
6
6
  Author-email: <rcording@uw.ed>
@@ -25,7 +25,7 @@ mgpsogui/gui/SetupTab/SetupTab.py,sha256=3V8LYvg5ulTll1hhguB_XpSoOR-w72vHh_Z3gw3
25
25
  mgpsogui/gui/SetupTab/StepView.py,sha256=M_7gj3TqszMs0pVBnGmZZDr96NWZg5mfKyX1Ne1MIrc,9018
26
26
  mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  mgpsogui/gui/VisualizeTab/MatrixEditor.py,sha256=Gzyl2hRgjIfO5n0bCZZoXp_vOFvfsJPaGXDUMeRQg10,3171
28
- mgpsogui/gui/VisualizeTab/SideBar.py,sha256=wPjzA8ZZsCTxBKN0_6-_ABtU5BeHqytNAWfKCWAPoe8,22106
28
+ mgpsogui/gui/VisualizeTab/SideBar.py,sha256=GaQiha5lwEseonfsW5nYBlFAJZV3rdDj53LyocuWibk,23432
29
29
  mgpsogui/gui/VisualizeTab/VisualizeTab.py,sha256=Ro-K-P7aIcDM5GF-4QkUSo-HeLZANapybU07BRicwVw,6589
30
30
  mgpsogui/gui/VisualizeTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  mgpsogui/gui/defaults/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -69,8 +69,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
69
69
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
70
70
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
71
71
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
72
- mg_pso_gui-0.2.75.dist-info/METADATA,sha256=2vV_74kLeJ2YnZREuoAu34UUkG39n2Zd7FT4S8jEXeI,9455
73
- mg_pso_gui-0.2.75.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
74
- mg_pso_gui-0.2.75.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
75
- mg_pso_gui-0.2.75.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
76
- mg_pso_gui-0.2.75.dist-info/RECORD,,
72
+ mg_pso_gui-0.2.76.dist-info/METADATA,sha256=OAir1c1RT13M0LyJv7fMmEbeeBH8rjCuFjEGuq8z7Mk,9455
73
+ mg_pso_gui-0.2.76.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
74
+ mg_pso_gui-0.2.76.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
75
+ mg_pso_gui-0.2.76.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
76
+ mg_pso_gui-0.2.76.dist-info/RECORD,,
@@ -39,303 +39,309 @@ class SideBar(CTkScrollableFrame):
39
39
  0, 0), pady=(0, 0), sticky="ew")
40
40
  self.containerFrame.grid_columnconfigure(0, weight=1)
41
41
 
42
- selected_graph = self.option_manager.get("selected_graph").get()
43
-
44
- if (selected_graph == "Best Cost Stacked"):
45
- #self.graph_label = CTkLabel(self.containerFrame, text="Best Cost Stacked")
46
- #self.graph_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
47
- pass
48
- elif (selected_graph == "Best Cost by Round"):
49
- #self.graph_label = CTkLabel(self.containerFrame, text="Best Cost by Round")
50
- #self.graph_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
51
- pass
52
- elif (selected_graph == "Iteration Table"):
53
- #self.graph_label = CTkLabel(self.containerFrame, text="Iteration Table")
54
- #self.graph_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
55
- pass
56
- elif (selected_graph == "Calibrated Parameters"):
57
- #self.graph_label = CTkLabel(self.containerFrame, text="Calibrated Parameters")
58
- #self.graph_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
59
- pass
60
- elif (selected_graph == "Custom CSV"):
61
-
62
- folder = self.option_manager.get_project_folder()
63
- if not os.path.exists(folder):
64
- os.makedirs(folder)
65
-
66
- # Get all CSV files in the folder and add their paths to a list
67
- path_map = {}
68
- name_list = []
69
- for root, dirs, files in os.walk(folder):
70
- for file in files:
71
- if file.endswith(".csv"):
72
- name = file.replace(".csv", "")
73
- name_list.append(name)
74
- path_map[name] = os.path.join(root, file)
75
-
76
- if (len(name_list) == 0):
77
- name_list.append("No files found...")
78
- else:
79
- if (self.option_manager.get("selected_csv").get() not in name_list):
80
- self.option_manager.get("selected_csv").set(name_list[0])
81
-
82
- file_label = CTkLabel(self.containerFrame, text="CSV File:")
83
- file_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
84
-
85
- self.home_page.csv_file_selector = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv"), command=self.home_page.update_graph)
86
- self.home_page.csv_file_selector.grid(row=1, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
42
+ try:
43
+ self.option_manager.get("selected_graph").set("Best Cost Stacked")
44
+
45
+ selected_graph = self.option_manager.get("selected_graph").get()
87
46
 
88
- selected_file = self.option_manager.get("selected_csv").get()
89
- if (selected_file in path_map and selected_file != self.home_page.open_file):
90
- self.home_page.csv_data = self.load_special_csv(path_map[selected_file])
91
- print(self.home_page.csv_data)
92
- self.home_page.open_file = selected_file
93
-
94
- if (self.home_page.csv_data is not None):
95
- # Get all column names of CSV
96
- columns = self.home_page.csv_data["data"].columns
97
-
98
- x_axis_label = CTkLabel(self.containerFrame, text="X Axis:")
99
- x_axis_label.grid(row=2, column=0, padx=(20, 20), pady=(40, 5), sticky="w")
100
-
101
- self.home_page.csv_x_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_x"), command=self.home_page.update_graph)
102
- self.home_page.csv_x_selector.grid(row=3, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
103
-
104
- if (self.home_page.csv_x_selector.get() not in columns):
105
- self.home_page.csv_x_selector.set(columns[1])
106
-
107
- y1_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
108
- y1_axis_label.grid(row=4, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
109
-
110
- self.home_page.csv_y1_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y1"), command=self.home_page.update_graph)
111
- self.home_page.csv_y1_selector.grid(row=5, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
112
-
113
- if (self.home_page.csv_y1_selector.get() not in columns):
114
- self.home_page.csv_y1_selector.set(columns[2])
115
-
116
- y2_axis_label = CTkLabel(self.containerFrame, text="Secondary Y Axis:")
117
- y2_axis_label.grid(row=6, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
118
-
119
- self.home_page.csv_y2_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y2"), command=self.home_page.update_graph)
120
- self.home_page.csv_y2_selector.grid(row=7, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
121
-
122
- if (self.home_page.csv_y2_selector.get() not in columns):
123
- self.home_page.csv_y2_selector.set(columns[3])
47
+ if (selected_graph == "Best Cost Stacked"):
48
+ #self.graph_label = CTkLabel(self.containerFrame, text="Best Cost Stacked")
49
+ #self.graph_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
50
+ pass
51
+ elif (selected_graph == "Best Cost by Round"):
52
+ #self.graph_label = CTkLabel(self.containerFrame, text="Best Cost by Round")
53
+ #self.graph_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
54
+ pass
55
+ elif (selected_graph == "Iteration Table"):
56
+ #self.graph_label = CTkLabel(self.containerFrame, text="Iteration Table")
57
+ #self.graph_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
58
+ pass
59
+ elif (selected_graph == "Calibrated Parameters"):
60
+ #self.graph_label = CTkLabel(self.containerFrame, text="Calibrated Parameters")
61
+ #self.graph_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
62
+ pass
63
+ elif (selected_graph == "Custom CSV"):
64
+
65
+ folder = self.option_manager.get_project_folder()
66
+ if not os.path.exists(folder):
67
+ os.makedirs(folder)
124
68
 
125
- elif (selected_graph == "Compare CSV"):
126
- folder = self.option_manager.get_project_folder()
127
- if not os.path.exists(folder):
128
- os.makedirs(folder)
129
-
130
- # Get all CSV files in the folder and add their paths to a list
131
- path_map = {}
132
- name_list = []
133
- for root, dirs, files in os.walk(folder):
134
- for file in files:
135
- if file.endswith(".csv"):
136
- name = file.replace(".csv", "")
137
- name_list.append(name)
138
- path_map[name] = os.path.join(root, file)
139
-
140
- if (len(name_list) == 0):
141
- name_list.append("No files found...")
142
- else:
143
- if (self.option_manager.get("selected_csv").get() not in name_list):
144
- self.option_manager.get("selected_csv").set(name_list[0])
145
- if (self.option_manager.get("selected_csv2").get() not in name_list):
146
- self.option_manager.get("selected_csv2").set(name_list[0])
147
-
148
- file_label = CTkLabel(self.containerFrame, text="CSV Files:")
149
- file_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
150
-
151
- self.home_page.csv_file_selector = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv"), command=self.home_page.update_graph)
152
- self.home_page.csv_file_selector.grid(row=1, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
153
-
154
- self.home_page.csv_file_selector2 = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv2"), command=self.home_page.update_graph)
155
- self.home_page.csv_file_selector2.grid(row=2, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
156
-
157
- selected_file = self.option_manager.get("selected_csv").get()
158
- if (selected_file in path_map and selected_file != self.home_page.open_file):
159
- self.home_page.csv_data = self.load_special_csv(path_map[selected_file])
160
- print(self.home_page.csv_data)
161
- self.home_page.open_file = selected_file
162
-
163
- selected_file2 = self.option_manager.get("selected_csv2").get()
164
- if (selected_file2 in path_map and selected_file2 != self.home_page.open_file2):
165
- self.home_page.csv_data2 = self.load_special_csv(path_map[selected_file2])
166
- print(self.home_page.csv_data2)
167
- self.home_page.open_file2 = selected_file2
168
-
169
- if (self.home_page.csv_data is not None and self.home_page.csv_data2 is not None):
170
- # Get all column names of CSV
171
- columns = self.home_page.csv_data["data"].columns
172
- columns2 = self.home_page.csv_data2["data"].columns
173
-
174
- x_axis_label = CTkLabel(self.containerFrame, text="X Axis:")
175
- x_axis_label.grid(row=3, column=0, padx=(20, 20), pady=(40, 5), sticky="w")
176
-
177
- self.home_page.csv_x_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_x"), command=self.home_page.update_graph)
178
- self.home_page.csv_x_selector.grid(row=4, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
179
-
180
- if (self.home_page.csv_x_selector.get() not in columns):
181
- self.home_page.csv_x_selector.set(columns[1])
182
-
183
- y1_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
184
- y1_axis_label.grid(row=5, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
185
-
186
- self.home_page.csv_y1_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y1"), command=self.home_page.update_graph)
187
- self.home_page.csv_y1_selector.grid(row=6, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
188
-
189
- if (self.home_page.csv_y1_selector.get() not in columns):
190
- self.home_page.csv_y1_selector.set(columns[2])
191
-
192
- y2_axis_label = CTkLabel(self.containerFrame, text="Secondary Y Axis:")
193
- y2_axis_label.grid(row=7, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
194
-
195
- self.home_page.csv_y2_selector = CTkOptionMenu(self.containerFrame, values=columns2, variable=self.option_manager.get("selected_y2"), command=self.home_page.update_graph)
196
- self.home_page.csv_y2_selector.grid(row=8, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
197
-
198
- if (self.home_page.csv_y2_selector.get() not in columns2):
199
- self.home_page.csv_y2_selector.set(columns2[2])
69
+ # Get all CSV files in the folder and add their paths to a list
70
+ path_map = {}
71
+ name_list = []
72
+ for root, dirs, files in os.walk(folder):
73
+ for file in files:
74
+ if file.endswith(".csv"):
75
+ name = file.replace(".csv", "")
76
+ name_list.append(name)
77
+ path_map[name] = os.path.join(root, file)
78
+
79
+ if (len(name_list) == 0):
80
+ name_list.append("No files found...")
81
+ else:
82
+ if (self.option_manager.get("selected_csv").get() not in name_list):
83
+ self.option_manager.get("selected_csv").set(name_list[0])
84
+
85
+ file_label = CTkLabel(self.containerFrame, text="CSV File:")
86
+ file_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
87
+
88
+ self.home_page.csv_file_selector = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv"), command=self.home_page.update_graph)
89
+ self.home_page.csv_file_selector.grid(row=1, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
90
+
91
+ selected_file = self.option_manager.get("selected_csv").get()
92
+ if (selected_file in path_map and selected_file != self.home_page.open_file):
93
+ self.home_page.csv_data = self.load_special_csv(path_map[selected_file])
94
+ print(self.home_page.csv_data)
95
+ self.home_page.open_file = selected_file
200
96
 
201
- elif (selected_graph == "Sampling CSV"):
202
-
203
- folder = self.option_manager.get_project_folder()
204
- if not os.path.exists(folder):
205
- os.makedirs(folder)
206
-
207
- # Get all CSV files in the folder and add their paths to a list
208
- path_map = {}
209
- name_list = []
210
- for root, dirs, files in os.walk(folder):
211
- for file in files:
212
- if file.endswith(".csv"):
213
- name = file.replace(".csv", "")
214
- name_list.append(name)
215
- path_map[name] = os.path.join(root, file)
216
-
217
- if (len(name_list) == 0):
218
- name_list.append("No files found...")
219
- else:
220
- if (self.option_manager.get("selected_csv").get() not in name_list):
221
- self.option_manager.get("selected_csv").set(name_list[0])
222
-
223
- file_label = CTkLabel(self.containerFrame, text="CSV File:")
224
- file_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
225
-
226
- self.home_page.csv_file_selector = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv"), command=self.home_page.update_graph)
227
- self.home_page.csv_file_selector.grid(row=1, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
228
-
229
- selected_file = self.option_manager.get("selected_csv").get()
230
- if (selected_file in path_map and selected_file != self.home_page.open_file):
231
- self.home_page.csv_data = pd.read_csv(path_map[selected_file])
232
- print(self.home_page.csv_data)
233
- self.home_page.open_file = selected_file
234
-
235
- if (self.home_page.csv_data is not None):
236
- # Get all column names of CSV
237
- columns = self.home_page.csv_data.columns
238
-
239
- x_axis_label = CTkLabel(self.containerFrame, text="X Axis:")
240
- x_axis_label.grid(row=2, column=0, padx=(20, 20), pady=(40, 5), sticky="w")
241
-
242
- self.home_page.csv_x_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_x"), command=self.home_page.update_graph)
243
- self.home_page.csv_x_selector.grid(row=3, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
244
-
245
- if (self.home_page.csv_x_selector.get() not in columns):
246
- self.home_page.csv_x_selector.set(columns[1])
247
-
248
- y1_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
249
- y1_axis_label.grid(row=4, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
250
-
251
- self.home_page.csv_y1_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y1"), command=self.home_page.update_graph)
252
- self.home_page.csv_y1_selector.grid(row=5, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
253
-
254
- if (self.home_page.csv_y1_selector.get() not in columns):
255
- self.home_page.csv_y1_selector.set(columns[2])
256
-
257
- y2_axis_label = CTkLabel(self.containerFrame, text="Secondary Y Axis:")
258
- y2_axis_label.grid(row=6, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
259
-
260
- self.home_page.csv_y2_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y2"), command=self.home_page.update_graph)
261
- self.home_page.csv_y2_selector.grid(row=7, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
97
+ if (self.home_page.csv_data is not None):
98
+ # Get all column names of CSV
99
+ columns = self.home_page.csv_data["data"].columns
100
+
101
+ x_axis_label = CTkLabel(self.containerFrame, text="X Axis:")
102
+ x_axis_label.grid(row=2, column=0, padx=(20, 20), pady=(40, 5), sticky="w")
103
+
104
+ self.home_page.csv_x_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_x"), command=self.home_page.update_graph)
105
+ self.home_page.csv_x_selector.grid(row=3, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
106
+
107
+ if (self.home_page.csv_x_selector.get() not in columns):
108
+ self.home_page.csv_x_selector.set(columns[1])
109
+
110
+ y1_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
111
+ y1_axis_label.grid(row=4, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
112
+
113
+ self.home_page.csv_y1_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y1"), command=self.home_page.update_graph)
114
+ self.home_page.csv_y1_selector.grid(row=5, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
115
+
116
+ if (self.home_page.csv_y1_selector.get() not in columns):
117
+ self.home_page.csv_y1_selector.set(columns[2])
118
+
119
+ y2_axis_label = CTkLabel(self.containerFrame, text="Secondary Y Axis:")
120
+ y2_axis_label.grid(row=6, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
121
+
122
+ self.home_page.csv_y2_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y2"), command=self.home_page.update_graph)
123
+ self.home_page.csv_y2_selector.grid(row=7, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
124
+
125
+ if (self.home_page.csv_y2_selector.get() not in columns):
126
+ self.home_page.csv_y2_selector.set(columns[3])
127
+
128
+ elif (selected_graph == "Compare CSV"):
129
+ folder = self.option_manager.get_project_folder()
130
+ if not os.path.exists(folder):
131
+ os.makedirs(folder)
132
+
133
+ # Get all CSV files in the folder and add their paths to a list
134
+ path_map = {}
135
+ name_list = []
136
+ for root, dirs, files in os.walk(folder):
137
+ for file in files:
138
+ if file.endswith(".csv"):
139
+ name = file.replace(".csv", "")
140
+ name_list.append(name)
141
+ path_map[name] = os.path.join(root, file)
142
+
143
+ if (len(name_list) == 0):
144
+ name_list.append("No files found...")
145
+ else:
146
+ if (self.option_manager.get("selected_csv").get() not in name_list):
147
+ self.option_manager.get("selected_csv").set(name_list[0])
148
+ if (self.option_manager.get("selected_csv2").get() not in name_list):
149
+ self.option_manager.get("selected_csv2").set(name_list[0])
150
+
151
+ file_label = CTkLabel(self.containerFrame, text="CSV Files:")
152
+ file_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
153
+
154
+ self.home_page.csv_file_selector = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv"), command=self.home_page.update_graph)
155
+ self.home_page.csv_file_selector.grid(row=1, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
156
+
157
+ self.home_page.csv_file_selector2 = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv2"), command=self.home_page.update_graph)
158
+ self.home_page.csv_file_selector2.grid(row=2, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
159
+
160
+ selected_file = self.option_manager.get("selected_csv").get()
161
+ if (selected_file in path_map and selected_file != self.home_page.open_file):
162
+ self.home_page.csv_data = self.load_special_csv(path_map[selected_file])
163
+ print(self.home_page.csv_data)
164
+ self.home_page.open_file = selected_file
165
+
166
+ selected_file2 = self.option_manager.get("selected_csv2").get()
167
+ if (selected_file2 in path_map and selected_file2 != self.home_page.open_file2):
168
+ self.home_page.csv_data2 = self.load_special_csv(path_map[selected_file2])
169
+ print(self.home_page.csv_data2)
170
+ self.home_page.open_file2 = selected_file2
171
+
172
+ if (self.home_page.csv_data is not None and self.home_page.csv_data2 is not None):
173
+ # Get all column names of CSV
174
+ columns = self.home_page.csv_data["data"].columns
175
+ columns2 = self.home_page.csv_data2["data"].columns
176
+
177
+ x_axis_label = CTkLabel(self.containerFrame, text="X Axis:")
178
+ x_axis_label.grid(row=3, column=0, padx=(20, 20), pady=(40, 5), sticky="w")
179
+
180
+ self.home_page.csv_x_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_x"), command=self.home_page.update_graph)
181
+ self.home_page.csv_x_selector.grid(row=4, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
182
+
183
+ if (self.home_page.csv_x_selector.get() not in columns):
184
+ self.home_page.csv_x_selector.set(columns[1])
185
+
186
+ y1_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
187
+ y1_axis_label.grid(row=5, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
188
+
189
+ self.home_page.csv_y1_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y1"), command=self.home_page.update_graph)
190
+ self.home_page.csv_y1_selector.grid(row=6, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
191
+
192
+ if (self.home_page.csv_y1_selector.get() not in columns):
193
+ self.home_page.csv_y1_selector.set(columns[2])
194
+
195
+ y2_axis_label = CTkLabel(self.containerFrame, text="Secondary Y Axis:")
196
+ y2_axis_label.grid(row=7, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
197
+
198
+ self.home_page.csv_y2_selector = CTkOptionMenu(self.containerFrame, values=columns2, variable=self.option_manager.get("selected_y2"), command=self.home_page.update_graph)
199
+ self.home_page.csv_y2_selector.grid(row=8, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
200
+
201
+ if (self.home_page.csv_y2_selector.get() not in columns2):
202
+ self.home_page.csv_y2_selector.set(columns2[2])
203
+
204
+ elif (selected_graph == "Sampling CSV"):
262
205
 
263
- if (self.home_page.csv_y2_selector.get() not in columns):
264
- self.home_page.csv_y2_selector.set(columns[3])
206
+ folder = self.option_manager.get_project_folder()
207
+ if not os.path.exists(folder):
208
+ os.makedirs(folder)
209
+
210
+ # Get all CSV files in the folder and add their paths to a list
211
+ path_map = {}
212
+ name_list = []
213
+ for root, dirs, files in os.walk(folder):
214
+ for file in files:
215
+ if file.endswith(".csv"):
216
+ name = file.replace(".csv", "")
217
+ name_list.append(name)
218
+ path_map[name] = os.path.join(root, file)
219
+
220
+ if (len(name_list) == 0):
221
+ name_list.append("No files found...")
222
+ else:
223
+ if (self.option_manager.get("selected_csv").get() not in name_list):
224
+ self.option_manager.get("selected_csv").set(name_list[0])
225
+
226
+ file_label = CTkLabel(self.containerFrame, text="CSV File:")
227
+ file_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
228
+
229
+ self.home_page.csv_file_selector = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv"), command=self.home_page.update_graph)
230
+ self.home_page.csv_file_selector.grid(row=1, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
231
+
232
+ selected_file = self.option_manager.get("selected_csv").get()
233
+ if (selected_file in path_map and selected_file != self.home_page.open_file):
234
+ self.home_page.csv_data = pd.read_csv(path_map[selected_file])
235
+ print(self.home_page.csv_data)
236
+ self.home_page.open_file = selected_file
237
+
238
+ if (self.home_page.csv_data is not None):
239
+ # Get all column names of CSV
240
+ columns = self.home_page.csv_data.columns
241
+
242
+ x_axis_label = CTkLabel(self.containerFrame, text="X Axis:")
243
+ x_axis_label.grid(row=2, column=0, padx=(20, 20), pady=(40, 5), sticky="w")
244
+
245
+ self.home_page.csv_x_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_x"), command=self.home_page.update_graph)
246
+ self.home_page.csv_x_selector.grid(row=3, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
247
+
248
+ if (self.home_page.csv_x_selector.get() not in columns):
249
+ self.home_page.csv_x_selector.set(columns[1])
250
+
251
+ y1_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
252
+ y1_axis_label.grid(row=4, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
253
+
254
+ self.home_page.csv_y1_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y1"), command=self.home_page.update_graph)
255
+ self.home_page.csv_y1_selector.grid(row=5, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
256
+
257
+ if (self.home_page.csv_y1_selector.get() not in columns):
258
+ self.home_page.csv_y1_selector.set(columns[2])
259
+
260
+ y2_axis_label = CTkLabel(self.containerFrame, text="Secondary Y Axis:")
261
+ y2_axis_label.grid(row=6, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
262
+
263
+ self.home_page.csv_y2_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y2"), command=self.home_page.update_graph)
264
+ self.home_page.csv_y2_selector.grid(row=7, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
265
+
266
+ if (self.home_page.csv_y2_selector.get() not in columns):
267
+ self.home_page.csv_y2_selector.set(columns[3])
265
268
 
266
- style_label = CTkLabel(self.containerFrame, text="Figure Style:")
267
- style_label.grid(row=8, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
268
-
269
- self.home_page.figure_style_selector = CTkOptionMenu(self.containerFrame, values=["Scatter", "Bars", "Lines", "Area", "Box"], variable=self.option_manager.get("figure_style"), command=self.home_page.update_graph)
270
- self.home_page.figure_style_selector.grid(row=9, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
269
+ style_label = CTkLabel(self.containerFrame, text="Figure Style:")
270
+ style_label.grid(row=8, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
271
+
272
+ self.home_page.figure_style_selector = CTkOptionMenu(self.containerFrame, values=["Scatter", "Bars", "Lines", "Area", "Box"], variable=self.option_manager.get("figure_style"), command=self.home_page.update_graph)
273
+ self.home_page.figure_style_selector.grid(row=9, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
271
274
 
272
- elif (selected_graph == "Matrix Editor"):
273
-
274
- folder = self.option_manager.get_project_folder()
275
- if not os.path.exists(folder):
276
- os.makedirs(folder)
277
-
278
- # Get all CSV files in the folder and add their paths to a list
279
- path_map = {}
280
- name_list = []
281
- for root, dirs, files in os.walk(folder):
282
- for file in files:
283
- if file.endswith(".csv"):
284
- name = file.replace(".csv", "")
285
- name_list.append(name)
286
- path_map[name] = os.path.join(root, file)
287
-
288
- if (len(name_list) == 0):
289
- name_list.append("No files found...")
290
- else:
291
- if (self.option_manager.get("selected_csv").get() not in name_list):
292
- self.option_manager.get("selected_csv").set(name_list[0])
293
-
294
- file_label = CTkLabel(self.containerFrame, text="CSV File:")
295
- file_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
296
-
297
- self.home_page.csv_file_selector = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv"), command=self.home_page.update_graph)
298
- self.home_page.csv_file_selector.grid(row=1, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
299
-
300
- selected_file = self.option_manager.get("selected_csv").get()
301
- if (selected_file in path_map and selected_file != self.home_page.open_file):
302
- self.home_page.csv_data = pd.read_csv(path_map[selected_file])
303
- print(self.home_page.csv_data)
304
- self.home_page.open_file = selected_file
305
-
306
- if (self.home_page.csv_data is not None):
307
- # Get all column names of CSV
308
- columns = self.home_page.csv_data.columns
309
-
310
- style_label = CTkLabel(self.containerFrame, text="Figure Style:")
311
- style_label.grid(row=2, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
275
+ elif (selected_graph == "Matrix Editor"):
312
276
 
313
- self.home_page.figure_style_selector = CTkOptionMenu(self.containerFrame, values=["Scatter", "Bars", "Lines", "Area", "Box"], variable=self.option_manager.get("figure_style"), command=self.home_page.update_graph)
314
- self.home_page.figure_style_selector.grid(row=3, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
277
+ folder = self.option_manager.get_project_folder()
278
+ if not os.path.exists(folder):
279
+ os.makedirs(folder)
280
+
281
+ # Get all CSV files in the folder and add their paths to a list
282
+ path_map = {}
283
+ name_list = []
284
+ for root, dirs, files in os.walk(folder):
285
+ for file in files:
286
+ if file.endswith(".csv"):
287
+ name = file.replace(".csv", "")
288
+ name_list.append(name)
289
+ path_map[name] = os.path.join(root, file)
290
+
291
+ if (len(name_list) == 0):
292
+ name_list.append("No files found...")
293
+ else:
294
+ if (self.option_manager.get("selected_csv").get() not in name_list):
295
+ self.option_manager.get("selected_csv").set(name_list[0])
296
+
297
+ file_label = CTkLabel(self.containerFrame, text="CSV File:")
298
+ file_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
299
+
300
+ self.home_page.csv_file_selector = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.option_manager.get("selected_csv"), command=self.home_page.update_graph)
301
+ self.home_page.csv_file_selector.grid(row=1, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
302
+
303
+ selected_file = self.option_manager.get("selected_csv").get()
304
+ if (selected_file in path_map and selected_file != self.home_page.open_file):
305
+ self.home_page.csv_data = pd.read_csv(path_map[selected_file])
306
+ print(self.home_page.csv_data)
307
+ self.home_page.open_file = selected_file
308
+
309
+ if (self.home_page.csv_data is not None):
310
+ # Get all column names of CSV
311
+ columns = self.home_page.csv_data.columns
312
+
313
+ style_label = CTkLabel(self.containerFrame, text="Figure Style:")
314
+ style_label.grid(row=2, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
315
+
316
+ self.home_page.figure_style_selector = CTkOptionMenu(self.containerFrame, values=["Scatter", "Bars", "Lines", "Area", "Box"], variable=self.option_manager.get("figure_style"), command=self.home_page.update_graph)
317
+ self.home_page.figure_style_selector.grid(row=3, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
315
318
 
316
- x_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
317
- x_axis_label.grid(row=4, column=0, padx=(20, 20), pady=(40, 5), sticky="w")
318
-
319
- self.home_page.csv_x_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_x"), command=self.home_page.update_graph)
320
- self.home_page.csv_x_selector.grid(row=5, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
321
-
322
- if (self.home_page.csv_x_selector.get() not in columns):
323
- self.home_page.csv_x_selector.set(columns[1])
324
-
325
- self.matrix_editor = me.MatrixEditor(self.containerFrame, width=280, option_manager=self.option_manager, home_page=self.home_page, columns=columns)
326
- self.matrix_editor.grid(row=6, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
327
- self.matrix_editor.grid_columnconfigure(0, weight=1)
328
- self.matrix_editor.grid_rowconfigure(0, weight=1)
319
+ x_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
320
+ x_axis_label.grid(row=4, column=0, padx=(20, 20), pady=(40, 5), sticky="w")
321
+
322
+ self.home_page.csv_x_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_x"), command=self.home_page.update_graph)
323
+ self.home_page.csv_x_selector.grid(row=5, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
324
+
325
+ if (self.home_page.csv_x_selector.get() not in columns):
326
+ self.home_page.csv_x_selector.set(columns[1])
327
+
328
+ self.matrix_editor = me.MatrixEditor(self.containerFrame, width=280, option_manager=self.option_manager, home_page=self.home_page, columns=columns)
329
+ self.matrix_editor.grid(row=6, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
330
+ self.matrix_editor.grid_columnconfigure(0, weight=1)
331
+ self.matrix_editor.grid_rowconfigure(0, weight=1)
329
332
 
330
333
 
331
- #y1_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
332
- #y1_axis_label.grid(row=6, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
334
+ #y1_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
335
+ #y1_axis_label.grid(row=6, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
333
336
 
334
- #self.home_page.csv_y1_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y1"), command=self.home_page.update_graph)
335
- #self.home_page.csv_y1_selector.grid(row=7, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
336
-
337
- #if (self.home_page.csv_y1_selector.get() not in columns):
338
- # self.home_page.csv_y1_selector.set(columns[2])
337
+ #self.home_page.csv_y1_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.option_manager.get("selected_y1"), command=self.home_page.update_graph)
338
+ #self.home_page.csv_y1_selector.grid(row=7, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
339
+
340
+ #if (self.home_page.csv_y1_selector.get() not in columns):
341
+ # self.home_page.csv_y1_selector.set(columns[2])
342
+ except Exception as e:
343
+ print(e)
344
+ pass
339
345
 
340
346
  def load_special_csv(self, file_path):
341
347
  file_metadata = {}