dragon-ml-toolbox 3.12.5__tar.gz → 3.12.6__tar.gz

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.

Files changed (31) hide show
  1. {dragon_ml_toolbox-3.12.5/dragon_ml_toolbox.egg-info → dragon_ml_toolbox-3.12.6}/PKG-INFO +1 -1
  2. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6/dragon_ml_toolbox.egg-info}/PKG-INFO +1 -1
  3. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/GUI_tools.py +26 -10
  4. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/pyproject.toml +1 -1
  5. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/LICENSE +0 -0
  6. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/LICENSE-THIRD-PARTY.md +0 -0
  7. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/README.md +0 -0
  8. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/dragon_ml_toolbox.egg-info/SOURCES.txt +0 -0
  9. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/dragon_ml_toolbox.egg-info/dependency_links.txt +0 -0
  10. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/dragon_ml_toolbox.egg-info/requires.txt +0 -0
  11. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/dragon_ml_toolbox.egg-info/top_level.txt +0 -0
  12. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/ETL_engineering.py +0 -0
  13. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/MICE_imputation.py +0 -0
  14. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/ML_callbacks.py +0 -0
  15. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/ML_evaluation.py +0 -0
  16. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/ML_trainer.py +0 -0
  17. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/ML_tutorial.py +0 -0
  18. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/PSO_optimization.py +0 -0
  19. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/RNN_forecast.py +0 -0
  20. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/VIF_factor.py +0 -0
  21. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/__init__.py +0 -0
  22. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/_pytorch_models.py +0 -0
  23. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/data_exploration.py +0 -0
  24. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/datasetmaster.py +0 -0
  25. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/ensemble_learning.py +0 -0
  26. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/handle_excel.py +0 -0
  27. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/keys.py +0 -0
  28. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/logger.py +0 -0
  29. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/path_manager.py +0 -0
  30. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/ml_tools/utilities.py +0 -0
  31. {dragon_ml_toolbox-3.12.5 → dragon_ml_toolbox-3.12.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dragon-ml-toolbox
3
- Version: 3.12.5
3
+ Version: 3.12.6
4
4
  Summary: A collection of tools for data science and machine learning projects.
5
5
  Author-email: Karl Loza <luigiloza@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dragon-ml-toolbox
3
- Version: 3.12.5
3
+ Version: 3.12.6
4
4
  Summary: A collection of tools for data science and machine learning projects.
5
5
  Author-email: Karl Loza <luigiloza@gmail.com>
6
6
  License-Expression: MIT
@@ -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
- return [gui_columns]
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 ---
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dragon-ml-toolbox"
3
- version = "3.12.5"
3
+ version = "3.12.6"
4
4
  description = "A collection of tools for data science and machine learning projects."
5
5
  authors = [
6
6
  { name = "Karl Loza", email = "luigiloza@gmail.com" }