dragon-ml-toolbox 3.12.5__py3-none-any.whl → 3.12.6__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.
Potentially problematic release.
This version of dragon-ml-toolbox might be problematic. Click here for more details.
- {dragon_ml_toolbox-3.12.5.dist-info → dragon_ml_toolbox-3.12.6.dist-info}/METADATA +1 -1
- {dragon_ml_toolbox-3.12.5.dist-info → dragon_ml_toolbox-3.12.6.dist-info}/RECORD +7 -7
- ml_tools/GUI_tools.py +26 -10
- {dragon_ml_toolbox-3.12.5.dist-info → dragon_ml_toolbox-3.12.6.dist-info}/WHEEL +0 -0
- {dragon_ml_toolbox-3.12.5.dist-info → dragon_ml_toolbox-3.12.6.dist-info}/licenses/LICENSE +0 -0
- {dragon_ml_toolbox-3.12.5.dist-info → dragon_ml_toolbox-3.12.6.dist-info}/licenses/LICENSE-THIRD-PARTY.md +0 -0
- {dragon_ml_toolbox-3.12.5.dist-info → dragon_ml_toolbox-3.12.6.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
dragon_ml_toolbox-3.12.
|
|
2
|
-
dragon_ml_toolbox-3.12.
|
|
1
|
+
dragon_ml_toolbox-3.12.6.dist-info/licenses/LICENSE,sha256=2uUFNy7D0TLgHim1K5s3DIJ4q_KvxEXVilnU20cWliY,1066
|
|
2
|
+
dragon_ml_toolbox-3.12.6.dist-info/licenses/LICENSE-THIRD-PARTY.md,sha256=lY4_rJPnLnMu7YBQaY-_iz1JRDcLdQzNCyeLAF1glJY,1837
|
|
3
3
|
ml_tools/ETL_engineering.py,sha256=yeZsW_7zRvEcuMZbM4E2GV1dxwBoWIeJAcFFk2AK0fY,39502
|
|
4
|
-
ml_tools/GUI_tools.py,sha256=
|
|
4
|
+
ml_tools/GUI_tools.py,sha256=dkB2nxY1RxR_PDw6h2virWc9KR0E_C7elzVZ36uFJVM,45406
|
|
5
5
|
ml_tools/MICE_imputation.py,sha256=7CDsIQxx5Jb_DwPAmWmz3FXcn85sUyH7g9UcZ1_E07s,11412
|
|
6
6
|
ml_tools/ML_callbacks.py,sha256=g_9nSzoA22UJOQZCPKeDz-Ayh0ECFZLzRd6rZ8SokrE,13080
|
|
7
7
|
ml_tools/ML_evaluation.py,sha256=oiDV6HItQloUUKCUpltV-2pogubWLBieGpc-VUwosAQ,10106
|
|
@@ -20,7 +20,7 @@ ml_tools/keys.py,sha256=3YVbcYARSjE3vKr_6PavJSf7vXvlos7szu3qva4T3Ts,781
|
|
|
20
20
|
ml_tools/logger.py,sha256=UkbiU9ihBhw9VKyn3rZzisdClWV94EBV6B09_D0iUU0,6026
|
|
21
21
|
ml_tools/path_manager.py,sha256=1LD9JFzqVyJQl2kTA7tK930_IV3qxfiV4cMIBzItytY,8309
|
|
22
22
|
ml_tools/utilities.py,sha256=Vh4ZdI03g8EpgQL7KDwnAw2vtBlHtx6KxCuAATxLvT4,24208
|
|
23
|
-
dragon_ml_toolbox-3.12.
|
|
24
|
-
dragon_ml_toolbox-3.12.
|
|
25
|
-
dragon_ml_toolbox-3.12.
|
|
26
|
-
dragon_ml_toolbox-3.12.
|
|
23
|
+
dragon_ml_toolbox-3.12.6.dist-info/METADATA,sha256=qhni3r9Wsp7cx0WORT1m-xd3P_iqM7wdq08WIdC0g2U,3274
|
|
24
|
+
dragon_ml_toolbox-3.12.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
25
|
+
dragon_ml_toolbox-3.12.6.dist-info/top_level.txt,sha256=wm-oxax3ciyez6VoO4zsFd-gSok2VipYXnbg3TH9PtU,9
|
|
26
|
+
dragon_ml_toolbox-3.12.6.dist-info/RECORD,,
|
ml_tools/GUI_tools.py
CHANGED
|
@@ -191,13 +191,14 @@ class GUIFactory:
|
|
|
191
191
|
}
|
|
192
192
|
return sg.Button(text.title(), key=key, **style_args)
|
|
193
193
|
|
|
194
|
-
def make_frame(self, title: str, layout: List[List[Union[sg.Element, sg.Column]]], **kwargs) -> sg.Frame:
|
|
194
|
+
def make_frame(self, title: str, layout: List[List[Union[sg.Element, sg.Column]]], center_layout: bool = False, **kwargs) -> sg.Frame:
|
|
195
195
|
"""
|
|
196
196
|
Creates a styled frame around a given layout.
|
|
197
197
|
|
|
198
198
|
Args:
|
|
199
199
|
title (str): The title displayed on the frame's border.
|
|
200
200
|
layout (list): The layout to enclose within the frame.
|
|
201
|
+
center_layout (bool): If True, the content within the frame will be horizontally centered.
|
|
201
202
|
**kwargs: Override default styles or add other sg.Frame parameters
|
|
202
203
|
(e.g., `title_color='red'`, `relief=sg.RELIEF_SUNKEN`).
|
|
203
204
|
"""
|
|
@@ -210,6 +211,10 @@ class GUIFactory:
|
|
|
210
211
|
"background_color": sg.theme_background_color(),
|
|
211
212
|
**kwargs
|
|
212
213
|
}
|
|
214
|
+
|
|
215
|
+
if center_layout:
|
|
216
|
+
style_args["element_justification"] = 'center'
|
|
217
|
+
|
|
213
218
|
return sg.Frame(title, layout, **style_args)
|
|
214
219
|
|
|
215
220
|
# --- General-Purpose Layout Generators ---
|
|
@@ -218,7 +223,8 @@ class GUIFactory:
|
|
|
218
223
|
data_dict: Dict[str, Union[Tuple[Union[int,float,None], Union[int,float,None]],List[Union[int,float,None]]]],
|
|
219
224
|
is_target: bool = False,
|
|
220
225
|
layout_mode: Literal["grid", "row"] = 'grid',
|
|
221
|
-
number_columns: int = 5
|
|
226
|
+
number_columns: int = 5,
|
|
227
|
+
center_layout: bool = True
|
|
222
228
|
) -> List[List[sg.Column]]:
|
|
223
229
|
"""
|
|
224
230
|
Generates a layout for continuous features or targets.
|
|
@@ -228,6 +234,7 @@ class GUIFactory:
|
|
|
228
234
|
is_target (bool): If True, creates disabled inputs for displaying results.
|
|
229
235
|
layout_mode (str): 'grid' for a multi-row grid layout, or 'row' for a single horizontal row.
|
|
230
236
|
number_columns (int): Number of columns when `layout_mode` is 'grid'.
|
|
237
|
+
center_layout (bool): If True, the entire grid will be horizontally centered.
|
|
231
238
|
|
|
232
239
|
Returns:
|
|
233
240
|
A list of lists of sg.Column elements, ready to be used in a window layout.
|
|
@@ -264,7 +271,7 @@ class GUIFactory:
|
|
|
264
271
|
layout = [[label], [element]]
|
|
265
272
|
else:
|
|
266
273
|
range_font = (cfg.fonts.font_family, cfg.fonts.range_size) # type: ignore
|
|
267
|
-
range_text = sg.Text(f"Range: {val_min}-{val_max}", font=range_font, background_color=bg_color) # type: ignore
|
|
274
|
+
range_text = sg.Text(f"Range: {val_min} - {val_max}", font=range_font, background_color=bg_color) # type: ignore
|
|
268
275
|
layout = [[label], [element], [range_text]]
|
|
269
276
|
|
|
270
277
|
# each feature is wrapped as a column element
|
|
@@ -275,13 +282,14 @@ class GUIFactory:
|
|
|
275
282
|
return [all_feature_layouts] # A single row containing all features
|
|
276
283
|
|
|
277
284
|
# Default to 'grid' layout: delegate to the helper method
|
|
278
|
-
return self._build_grid_layout(all_feature_layouts, number_columns, bg_color) # type: ignore
|
|
285
|
+
return self._build_grid_layout(all_feature_layouts, number_columns, bg_color, center_layout) # type: ignore
|
|
279
286
|
|
|
280
287
|
def generate_combo_layout(
|
|
281
288
|
self,
|
|
282
289
|
data_dict: Dict[str, Union[List[Any],Tuple[Any,...]]],
|
|
283
290
|
layout_mode: Literal["grid", "row"] = 'grid',
|
|
284
|
-
number_columns: int = 5
|
|
291
|
+
number_columns: int = 5,
|
|
292
|
+
center_layout: bool = True
|
|
285
293
|
) -> List[List[sg.Column]]:
|
|
286
294
|
"""
|
|
287
295
|
Generates a layout for categorical or binary features using Combo boxes.
|
|
@@ -290,6 +298,7 @@ class GUIFactory:
|
|
|
290
298
|
data_dict (dict): Keys are feature names, values are lists of options.
|
|
291
299
|
layout_mode (str): 'grid' for a multi-row grid layout, or 'row' for a single horizontal row.
|
|
292
300
|
number_columns (int): Number of columns when `layout_mode` is 'grid'.
|
|
301
|
+
center_layout (bool): If True, the entire grid will be horizontally centered.
|
|
293
302
|
|
|
294
303
|
Returns:
|
|
295
304
|
A list of lists of sg.Column elements, ready to be used in a window layout.
|
|
@@ -315,13 +324,14 @@ class GUIFactory:
|
|
|
315
324
|
return [all_feature_layouts] # A single row containing all features
|
|
316
325
|
|
|
317
326
|
# Default to 'grid' layout: delegate to the helper method
|
|
318
|
-
return self._build_grid_layout(all_feature_layouts, number_columns, bg_color) # type: ignore
|
|
327
|
+
return self._build_grid_layout(all_feature_layouts, number_columns, bg_color, center_layout) # type: ignore
|
|
319
328
|
|
|
320
329
|
def generate_multiselect_layout(
|
|
321
330
|
self,
|
|
322
331
|
data_dict: Dict[str, Union[List[Any], Tuple[Any, ...]]],
|
|
323
332
|
layout_mode: Literal["grid", "row"] = 'grid',
|
|
324
|
-
number_columns: int = 5
|
|
333
|
+
number_columns: int = 5,
|
|
334
|
+
center_layout: bool = True
|
|
325
335
|
) -> List[List[sg.Column]]:
|
|
326
336
|
"""
|
|
327
337
|
Generates a layout for features using Listbox elements for multiple selections.
|
|
@@ -333,6 +343,7 @@ class GUIFactory:
|
|
|
333
343
|
data_dict (dict): Keys are feature names, values are lists of options.
|
|
334
344
|
layout_mode (str): 'grid' for a multi-row grid layout, or 'row' for a single horizontal row.
|
|
335
345
|
number_columns (int): Number of columns when `layout_mode` is 'grid'.
|
|
346
|
+
center_layout (bool): If True, the entire grid will be horizontally centered.
|
|
336
347
|
|
|
337
348
|
Returns:
|
|
338
349
|
A list of lists of sg.Column elements, ready to be used in a window layout.
|
|
@@ -366,7 +377,7 @@ class GUIFactory:
|
|
|
366
377
|
return [all_feature_layouts] # A single row containing all features
|
|
367
378
|
|
|
368
379
|
# Default to 'grid' layout: delegate to the helper method
|
|
369
|
-
return self._build_grid_layout(all_feature_layouts, number_columns, bg_color) # type: ignore
|
|
380
|
+
return self._build_grid_layout(all_feature_layouts, number_columns, bg_color, center_layout) # type: ignore
|
|
370
381
|
|
|
371
382
|
# --- Window Creation ---
|
|
372
383
|
def create_window(self, title: str, layout: List[List[sg.Element]], **kwargs) -> sg.Window:
|
|
@@ -396,7 +407,7 @@ class GUIFactory:
|
|
|
396
407
|
|
|
397
408
|
return window
|
|
398
409
|
|
|
399
|
-
def _build_grid_layout(self, all_feature_layouts: List[sg.Column], num_columns: int, bg_color: str) -> List[List[sg.Column]]:
|
|
410
|
+
def _build_grid_layout(self, all_feature_layouts: List[sg.Column], num_columns: int, bg_color: str, center_layout: bool = True) -> List[List[sg.Column]]:
|
|
400
411
|
"""
|
|
401
412
|
Private helper to distribute feature layouts vertically into a grid of columns.
|
|
402
413
|
"""
|
|
@@ -412,7 +423,12 @@ class GUIFactory:
|
|
|
412
423
|
gui_columns = [sg.Column([[c] for c in col], background_color=bg_color) for col in final_columns]
|
|
413
424
|
|
|
414
425
|
# Return a single row containing all the generated vertical columns
|
|
415
|
-
|
|
426
|
+
if center_layout:
|
|
427
|
+
# Return a single row containing the columns, centered with Push elements.
|
|
428
|
+
return [[sg.Push()] + gui_columns + [sg.Push()]] # type: ignore
|
|
429
|
+
else:
|
|
430
|
+
# Return a single row containing just the columns.
|
|
431
|
+
return [gui_columns]
|
|
416
432
|
|
|
417
433
|
|
|
418
434
|
# --- Exception Handling Decorator ---
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|