dragon-ml-toolbox 3.12.2__py3-none-any.whl → 3.12.4__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dragon-ml-toolbox
3
- Version: 3.12.2
3
+ Version: 3.12.4
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,7 +1,7 @@
1
- dragon_ml_toolbox-3.12.2.dist-info/licenses/LICENSE,sha256=2uUFNy7D0TLgHim1K5s3DIJ4q_KvxEXVilnU20cWliY,1066
2
- dragon_ml_toolbox-3.12.2.dist-info/licenses/LICENSE-THIRD-PARTY.md,sha256=lY4_rJPnLnMu7YBQaY-_iz1JRDcLdQzNCyeLAF1glJY,1837
1
+ dragon_ml_toolbox-3.12.4.dist-info/licenses/LICENSE,sha256=2uUFNy7D0TLgHim1K5s3DIJ4q_KvxEXVilnU20cWliY,1066
2
+ dragon_ml_toolbox-3.12.4.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=SkPqqY0xdxVq3C0hpcMVxEseVXzW3eT9jN1RUlP6qbA,43105
4
+ ml_tools/GUI_tools.py,sha256=H-S-6qiGQDb8SIp8KXMQRidpTRezOqBz0jaRedUlawA,43328
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.2.dist-info/METADATA,sha256=JyL5AgD0yfz5tZL8bT0w4EYlKwDwU5DbabfWQl77vNs,3274
24
- dragon_ml_toolbox-3.12.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
- dragon_ml_toolbox-3.12.2.dist-info/top_level.txt,sha256=wm-oxax3ciyez6VoO4zsFd-gSok2VipYXnbg3TH9PtU,9
26
- dragon_ml_toolbox-3.12.2.dist-info/RECORD,,
23
+ dragon_ml_toolbox-3.12.4.dist-info/METADATA,sha256=Bxg7mUA0PgndAOYuUOff1aIDYtaow3pNPk2pcfFcMCM,3274
24
+ dragon_ml_toolbox-3.12.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ dragon_ml_toolbox-3.12.4.dist-info/top_level.txt,sha256=wm-oxax3ciyez6VoO4zsFd-gSok2VipYXnbg3TH9PtU,9
26
+ dragon_ml_toolbox-3.12.4.dist-info/RECORD,,
ml_tools/GUI_tools.py CHANGED
@@ -68,41 +68,42 @@ class ConfigManager:
68
68
  if not config_path.exists():
69
69
  raise FileNotFoundError(f"Configuration file not found at: {config_path}")
70
70
 
71
- parser = configparser.ConfigParser(comment_prefixes=('#', ';'), inline_comment_prefixes=('#', ';'))
71
+ parser = configparser.ConfigParser(comment_prefixes=';', inline_comment_prefixes=';')
72
72
  parser.read(config_path)
73
73
 
74
74
  for section in parser.sections():
75
75
  setattr(self, section.lower(), _SectionProxy(parser, section))
76
76
 
77
77
  @staticmethod
78
- def generate_template(file_path: str | Path, force_overwrite: bool = False):
78
+ def generate_template(file_path: str | Path):
79
79
  """
80
80
  Generates a complete, commented .ini template file that works with the GUIFactory.
81
81
 
82
82
  Args:
83
83
  file_path (str | Path): The path where the .ini file will be saved.
84
- force_overwrite (bool): If True, overwrites the file if it already exists.
85
84
  """
85
+ if isinstance(file_path, str):
86
+ if not file_path.endswith(".ini"):
87
+ file_path = file_path + ".ini"
88
+
86
89
  path = Path(file_path)
87
- if path.exists() and not force_overwrite:
88
- _LOGGER.warning(f"⚠️ Configuration file already exists at {path}. Aborting.")
90
+ if path.exists():
91
+ _LOGGER.warning(f"⚠️ Configuration file already exists at {path}, or wrong path provided. Aborting.")
89
92
  return
90
93
 
91
94
  config = configparser.ConfigParser()
92
95
 
93
96
  config['General'] = {
94
- '; The overall theme for the GUI. Find more at https://www.pysimplegui.org/en/latest/call%20reference/#themes-automatic-coloring-of-elements': '',
97
+ '; The overall theme for the GUI.': '',
95
98
  'theme': 'LightGreen6',
96
- '; Default font for the application.': '',
97
- 'font_family': 'Helvetica',
98
99
  '; Title of the main window.': '',
99
100
  'window_title': 'My Application',
100
101
  '; Can the user resize the window? (true/false)': '',
101
102
  'resizable_window': 'false',
102
103
  '; Optional minimum window size (width,height). Leave blank for no minimum.': '',
103
- 'min_size': '800,600',
104
+ 'min_size': '1280,720',
104
105
  '; Optional maximum window size (width,height). Leave blank for no maximum.': '',
105
- 'max_size': ''
106
+ 'max_size': '2048,1152'
106
107
  }
107
108
  config['Layout'] = {
108
109
  '; Default size for continuous input boxes (width,height in characters/rows).': '',
@@ -115,18 +116,22 @@ class ConfigManager:
115
116
  'button_size': '15,2'
116
117
  }
117
118
  config['Fonts'] = {
119
+ '; Default font for the application.': '',
120
+ 'font_family': 'Helvetica',
118
121
  '; Font settings. Style can be "bold", "italic", "underline", or a combination.': '',
119
122
  'label_size': '11',
120
123
  'label_style': 'bold',
121
124
  'range_size': '9',
122
- 'range_style': '',
125
+ 'range_style': '""',
123
126
  'button_size': '14',
124
127
  'button_style': 'bold',
125
128
  'frame_size': '14',
126
- 'frame_style': ''
129
+ 'frame_style': '""'
127
130
  }
128
131
  config['Colors'] = {
129
132
  '; Use standard hex codes (e.g., #FFFFFF) or color names (e.g., white).': '',
133
+ '; Color for the text inside a standard input box.': '',
134
+ 'input_text': '#000000',
130
135
  '; Color for the text inside a disabled target/output box.': '',
131
136
  'target_text': '#0000D0',
132
137
  '; Background color for a disabled target/output box.': '',
@@ -160,7 +165,7 @@ class GUIFactory:
160
165
  """
161
166
  self.config = config
162
167
  sg.theme(self.config.general.theme) # type: ignore
163
- sg.set_options(font=(self.config.general.font_family, 12)) # type: ignore
168
+ sg.set_options(font=(self.config.fonts.font_family, 12)) # type: ignore
164
169
 
165
170
  # --- Atomic Element Generators ---
166
171
  def make_button(self, text: str, key: str, **kwargs) -> sg.Button:
@@ -244,7 +249,11 @@ class GUIFactory:
244
249
 
245
250
  label = sg.Text(name, font=label_font, background_color=bg_color, key=f"_text_{name}")
246
251
 
247
- input_style = {"size": cfg.layout.input_size_cont, "justification": "center"} # type: ignore
252
+ input_style = {
253
+ "size": cfg.layout.input_size_cont, # type: ignore
254
+ "justification": "center",
255
+ "text_color": cfg.colors.input_text # type: ignore
256
+ }
248
257
  if is_target:
249
258
  input_style["text_color"] = cfg.colors.target_text # type: ignore
250
259
  input_style["disabled_readonly_background_color"] = cfg.colors.target_background # type: ignore
@@ -255,7 +264,7 @@ class GUIFactory:
255
264
  layout = [[label], [element]]
256
265
  else:
257
266
  range_font = (cfg.fonts.font_family, cfg.fonts.range_size) # type: ignore
258
- range_text = sg.Text(f"Range: {int(val_min)}-{int(val_max)}", font=range_font, background_color=bg_color) # type: ignore
267
+ range_text = sg.Text(f"Range: {val_min}-{val_max}", font=range_font, background_color=bg_color) # type: ignore
259
268
  layout = [[label], [element], [range_text]]
260
269
 
261
270
  # each feature is wrapped as a column element
@@ -294,7 +303,8 @@ class GUIFactory:
294
303
  label = sg.Text(name, font=label_font, background_color=bg_color, key=f"_text_{name}")
295
304
  element = sg.Combo(
296
305
  values, default_value=values[0], key=name,
297
- size=cfg.layout.input_size_binary, readonly=True # type: ignore
306
+ size=cfg.layout.input_size_binary, readonly=True, # type: ignore
307
+ text_color=cfg.colors.input_text # type: ignore
298
308
  )
299
309
  layout = [[label], [element]]
300
310
  layout.append([sg.Text(" ", font=(cfg.fonts.font_family, 2), background_color=bg_color)]) # type: ignore
@@ -341,9 +351,9 @@ class GUIFactory:
341
351
  key=name,
342
352
  select_mode=sg.LISTBOX_SELECT_MODE_MULTIPLE,
343
353
  size=cfg.layout.input_size_multi, # type: ignore
344
- no_scrollbar=False
354
+ no_scrollbar=False,
355
+ text_color=cfg.colors.input_text # type: ignore
345
356
  )
346
- # -------------------
347
357
 
348
358
  layout = [[label], [element]]
349
359
  # Add a small spacer for consistent vertical alignment.