mg-pso-gui 0.1.40__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.
Files changed (50) hide show
  1. {mg_pso_gui-0.1.40.dist-info → mg_pso_gui-0.2.76.dist-info}/METADATA +10 -11
  2. mg_pso_gui-0.2.76.dist-info/RECORD +76 -0
  3. {mg_pso_gui-0.1.40.dist-info → mg_pso_gui-0.2.76.dist-info}/WHEEL +1 -1
  4. mgpsogui/gui/General/ParameterView.py +110 -0
  5. mgpsogui/gui/General/__init__.py +0 -0
  6. mgpsogui/gui/HomePage.py +234 -238
  7. mgpsogui/gui/OptionManager.py +333 -145
  8. mgpsogui/gui/OptionManager_backup.py +443 -0
  9. mgpsogui/gui/PlatformTab/PlatformTab.py +15 -6
  10. mgpsogui/gui/RunTab/OptimalParameterView.py +47 -0
  11. mgpsogui/gui/RunTab/RunTab.py +90 -17
  12. mgpsogui/gui/SetupTab/BoundsEditorWindow.py +1 -1
  13. mgpsogui/gui/SetupTab/BoundsList.py +97 -34
  14. mgpsogui/gui/SetupTab/CustomFunctionEditorWindow.py +74 -0
  15. mgpsogui/gui/SetupTab/CustomFunctionMetrics.py +156 -0
  16. mgpsogui/gui/SetupTab/FunctionsList.py +60 -6
  17. mgpsogui/gui/SetupTab/{StaticParameterView.py → ListEditor.py} +27 -16
  18. mgpsogui/gui/SetupTab/ListParametersView.py +7 -6
  19. mgpsogui/gui/SetupTab/{CalibrationParametersView.py → OverrideParameterMetrics.py} +35 -9
  20. mgpsogui/gui/SetupTab/OverrideParameterWindow.py +40 -0
  21. mgpsogui/gui/SetupTab/SetupTab.py +31 -11
  22. mgpsogui/gui/SetupTab/StepView.py +93 -22
  23. mgpsogui/gui/VisualizeTab/MatrixEditor.py +68 -0
  24. mgpsogui/gui/VisualizeTab/SideBar.py +358 -61
  25. mgpsogui/gui/VisualizeTab/VisualizeTab.py +69 -8
  26. mgpsogui/gui/defaults/__init__.py +0 -0
  27. mgpsogui/gui/defaults/optimization.json +176 -0
  28. mgpsogui/gui/defaults/sampling.json +111 -0
  29. mgpsogui/gui/defaults/sensitivity.json +20 -0
  30. mgpsogui/gui/images/plus.png +0 -0
  31. mgpsogui/util/GraphGenerator.py +721 -50
  32. mgpsogui/util/PSORunner.py +615 -86
  33. mgpsogui/util/debug.py +559 -0
  34. mgpsogui/util/helpers.py +95 -0
  35. mgpsogui/util/recosu/__init__.py +2 -1
  36. mgpsogui/util/recosu/pso/pso.py +55 -11
  37. mgpsogui/util/recosu/sampling/__init__.py +16 -0
  38. mgpsogui/util/recosu/sampling/halton/__init__.py +0 -0
  39. mgpsogui/util/recosu/sampling/halton/halton.py +45 -0
  40. mgpsogui/util/recosu/sampling/halton/prime.py +82 -0
  41. mgpsogui/util/recosu/sampling/random/__init__.py +0 -0
  42. mgpsogui/util/recosu/sampling/random/random_sampler.py +34 -0
  43. mgpsogui/util/recosu/sampling/sample_trace_writer.py +47 -0
  44. mgpsogui/util/recosu/sampling/sampler_task.py +75 -0
  45. mgpsogui/util/recosu/sampling/sampling.py +99 -0
  46. mgpsogui/util/sampler_test_driver.py +129 -0
  47. mg_pso_gui-0.1.40.dist-info/RECORD +0 -52
  48. mgpsogui/gui/images/IGOW 4 Logo.png +0 -0
  49. {mg_pso_gui-0.1.40.dist-info → mg_pso_gui-0.2.76.dist-info}/entry_points.txt +0 -0
  50. {mg_pso_gui-0.1.40.dist-info → mg_pso_gui-0.2.76.dist-info}/top_level.txt +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mg-pso-gui
3
- Version: 0.1.40
3
+ Version: 0.2.76
4
4
  Summary: GUI for MG-PSO
5
5
  Author: Robert Cordingly
6
6
  Author-email: <rcording@uw.ed>
7
7
  Keywords: python,muti-group,pso,particle,swarm,optimization,gui
8
8
  Classifier: Development Status :: 1 - Planning
9
9
  Classifier: Intended Audience :: Developers
10
- Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Operating System :: Unix
12
12
  Classifier: Operating System :: MacOS :: MacOS X
13
13
  Classifier: Operating System :: Microsoft :: Windows
@@ -23,7 +23,7 @@ Requires-Dist: csip-cosu
23
23
  Requires-Dist: kaleido
24
24
  Requires-Dist: pillow
25
25
 
26
- # Multigroup PSO Gui
26
+ # Multigroup PSO GUI
27
27
 
28
28
  This application provides an interface for setting up, configuring, running, and the visualization of multigroup PSO training.
29
29
 
@@ -49,7 +49,7 @@ mgpsogui
49
49
 
50
50
  You may need to add a folder to PATH.
51
51
 
52
- **Note:** If you run into an error saying that PIL.Image was not able to be imported on Ubuntu please force reinstall Pillow.
52
+ **Note:** If you run into an error saying that PIL.Image was not able to be imported on Ubuntu please force reinstall Pillow.
53
53
 
54
54
  ```bash
55
55
  python3 -m pip install --upgrade --force-reinstall Pillow
@@ -57,7 +57,7 @@ python3 -m pip install --upgrade --force-reinstall Pillow
57
57
 
58
58
  ## Instructions for Windows
59
59
 
60
- Download and install Python 3.10 through the Microsoft Store, this makes Python easily accessible in Windows Terminal.
60
+ Download and install Python 3.10 through the Microsoft Store, this makes Python easily accessible in Windows Terminal.
61
61
 
62
62
  Once installed run this command to install the interface:
63
63
 
@@ -79,7 +79,7 @@ C:\Users\robertcordingly\AppData\Local\Packages\PythonSoftwareFoundation.Python.
79
79
 
80
80
  ## Instructions for MacOS
81
81
 
82
- To install Tkinter and Python 3 it is best to use Homebrew:
82
+ To install Tkinter and Python 3 it is best to use Homebrew:
83
83
 
84
84
  Install Homebrew
85
85
 
@@ -103,15 +103,15 @@ Then install MG PSO Gui:
103
103
  python3 -m pip install mg-pso-gui
104
104
  ```
105
105
 
106
- You may need to add /Library/Frameworks/Python.framework/Versions/3.8/bin to path to run the interface with 'mgpsogui,' otherwise run the interface:
106
+ You may need to add /Library/Frameworks/Python.framework/Versions/3.10/bin to path to run the interface with 'mgpsogui,' otherwise run the interface:
107
107
 
108
108
  ```bash
109
- /Library/Frameworks/Python.framework/Versions/3.8/bin/mgpsogui
109
+ /Library/Frameworks/Python.framework/Versions/3.10/bin/mgpsogui
110
110
  ```
111
111
 
112
112
  # Getting Started
113
113
 
114
- After getting the GUI to launch, it is first recommended to start with one of the default config files. Default config files are available here: https://drive.google.com/file/d/1Ra4Um7KgCghMidyrrLrD6wFSXJZd3zkX/view?usp=share_link
114
+ After getting the GUI to launch, it is first recommended to start with one of the default config files. Default config files are available here: https://drive.google.com/file/d/1Ra4Um7KgCghMidyrrLrD6wFSXJZd3zkX/view?usp=share_link
115
115
 
116
116
  To load a config simply click the "load" button in the left side bar and select the file using the file picker. After a config has been loaded, enter a service URL, and click "Connect". If the connection is successful the other tabs on the interface will be unlocked and you will have full access to all of the interface's features.
117
117
 
@@ -123,7 +123,7 @@ Each tab of the interface serves a different purpose described here.
123
123
 
124
124
  The platform tab is where you defined the backend service used to train the model. If the service already exists, simply add the URL to the service field and press connect to get parameters from the service. After doing this the other tabs will unlock.
125
125
 
126
- If you do not already have a backend service deployed, the platform tab provides tools to create a local environment using Docker and Minikube.
126
+ If you do not already have a backend service deployed, the platform tab provides tools to create a local environment using Docker and Minikube.
127
127
 
128
128
  ## Setup
129
129
 
@@ -329,4 +329,3 @@ The Visualize tab allows you to generate a variety of different graphs and table
329
329
  ]
330
330
  }
331
331
  ```
332
-
@@ -0,0 +1,76 @@
1
+ mgpsogui/__init__.py,sha256=q7AfBjeJABnFtbsZnsObpUwaXKPDVYtz46G6MKXLF74,42
2
+ mgpsogui/mgpsogui.py,sha256=NIZmyNcbwC8EgSwf1ubdMUSJscrIEgoD4jLYziqHQ-k,148
3
+ mgpsogui/start.yaml,sha256=ZjCVLb-MLqAxrGRm9kA7_SDpa-45EuKIELNQ2QqCAiU,4713
4
+ mgpsogui/gui/HomePage.py,sha256=KwA_LtUepKMUQAg4yI6aWB_1Q9DR7wVlICct0GyTItw,22638
5
+ mgpsogui/gui/OptionManager.py,sha256=OczLGSmS9MfE2HgpPNw0OFbl2AdNQ_70pxQUKIDWAnU,21707
6
+ mgpsogui/gui/OptionManager_backup.py,sha256=TCWfPnHL2foN5id47jsi267lamRG6yGU6y_M29eOOJk,18530
7
+ mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ mgpsogui/gui/General/ParameterView.py,sha256=gTpsXQomHgWxdHhiMxjOk171PeefXqdpVQefH88PE_c,6384
9
+ mgpsogui/gui/General/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ mgpsogui/gui/PlatformTab/PlatformTab.py,sha256=XVaXjNoH1MBI-587CWigLIT3LGT00yzEAEnXNkzCLrk,10947
11
+ mgpsogui/gui/PlatformTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ mgpsogui/gui/RunTab/OptimalParameterView.py,sha256=nliUEWA840cPBQt7wjiZ-L7uBOp_ozzJhyBkL08fJzI,1752
13
+ mgpsogui/gui/RunTab/RunTab.py,sha256=47_r8K-e7f8zs93_2iPYnNBzHDHZejtedk7iSElkubU,5608
14
+ mgpsogui/gui/RunTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ mgpsogui/gui/SetupTab/BoundsEditorWindow.py,sha256=U64oaiDIOaimjbqKMz5rQNq2o1SrQtrRHDdTYQ9ux1s,2870
16
+ mgpsogui/gui/SetupTab/BoundsList.py,sha256=x1D1A0S0EAeKwuA5LFzcqslpws4O1mFUR6bKnuPTDMA,15221
17
+ mgpsogui/gui/SetupTab/CustomFunctionEditorWindow.py,sha256=yx0dHSNa7fGy99Q6qFcI6j9r8p0DlV3iOBgyPMGd8pM,2884
18
+ mgpsogui/gui/SetupTab/CustomFunctionMetrics.py,sha256=vOJpElbTgz043m6JYwe9xz_2MBHg985S6KdbJkJERW4,5923
19
+ mgpsogui/gui/SetupTab/FunctionsList.py,sha256=ntbIUs8q2Tm3KfBLleT7uL0gynwYuVycwvXv8vude3c,6611
20
+ mgpsogui/gui/SetupTab/ListEditor.py,sha256=nin7Pl8z7d_yfKoAxM-yVS34uhj-LnprJ2mNRSB7Z0A,3197
21
+ mgpsogui/gui/SetupTab/ListParametersView.py,sha256=mkGaC5cXhEOy5oD0MbTyK9z7VGZp019oK2Y8Ay-n05Q,7460
22
+ mgpsogui/gui/SetupTab/OverrideParameterMetrics.py,sha256=rBfaSitYDOajbHvyi2TfoXAHYlz1cCt028UVpIJ_Dc0,3369
23
+ mgpsogui/gui/SetupTab/OverrideParameterWindow.py,sha256=UpZDxTaFxee0BeviUYXeiIlMNYNy00qz3zlMlM5VcXE,1291
24
+ mgpsogui/gui/SetupTab/SetupTab.py,sha256=3V8LYvg5ulTll1hhguB_XpSoOR-w72vHh_Z3gw3nCxc,2758
25
+ mgpsogui/gui/SetupTab/StepView.py,sha256=M_7gj3TqszMs0pVBnGmZZDr96NWZg5mfKyX1Ne1MIrc,9018
26
+ mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ mgpsogui/gui/VisualizeTab/MatrixEditor.py,sha256=Gzyl2hRgjIfO5n0bCZZoXp_vOFvfsJPaGXDUMeRQg10,3171
28
+ mgpsogui/gui/VisualizeTab/SideBar.py,sha256=GaQiha5lwEseonfsW5nYBlFAJZV3rdDj53LyocuWibk,23432
29
+ mgpsogui/gui/VisualizeTab/VisualizeTab.py,sha256=Ro-K-P7aIcDM5GF-4QkUSo-HeLZANapybU07BRicwVw,6589
30
+ mgpsogui/gui/VisualizeTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
+ mgpsogui/gui/defaults/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ mgpsogui/gui/defaults/optimization.json,sha256=bd_XxTKtKN_ErZoxtZmhltWID-sDJAdxzsqt9qBSsh8,3629
33
+ mgpsogui/gui/defaults/sampling.json,sha256=0BZVXI_BiujDjR6VV1L5kSamRdSoDbBuTi1zRa6qtzM,2044
34
+ mgpsogui/gui/defaults/sensitivity.json,sha256=H3_4NKP6YsUGF73OjKyFNDwKfP_LmfykccDQPFLLvd8,396
35
+ mgpsogui/gui/images/collapse.png,sha256=yicb16LaY7Nl5q9V8HHlht-Fbg5xU-l4_LJ_Arfmu1c,2989
36
+ mgpsogui/gui/images/down.png,sha256=pspJkvUitD648C_2y8JLLD4Eagpk4MDEKQJGOO_yIaY,2654
37
+ mgpsogui/gui/images/expand.png,sha256=YQyxXipCiNiZpTok5Y4juNU5davxoK7MTlRQI4Id27w,2922
38
+ mgpsogui/gui/images/play.png,sha256=zbWtyZqvqCMT81bo6D3KhDPulWZH5lh1oCEs-X_X5Sk,2790
39
+ mgpsogui/gui/images/plus.png,sha256=X7QyYxzkgTWpF4ghfTIvYpYgkhyZSr1yQJtJmn1MAzs,2086
40
+ mgpsogui/gui/images/refresh.png,sha256=B1nbOlky6nVhgSjDWT35FLZKW2LWxmliWWP_qZjZ7k8,4657
41
+ mgpsogui/gui/images/refresh_hd.png,sha256=lprZtCNZ9JUm20SPwfaslr-VV4yzzmCPEB6oFfJm1tI,31242
42
+ mgpsogui/gui/images/stop.png,sha256=JPuxXQerCGpLikcp7cAj3iLCOjULMYYZ2sZe0lArh68,2153
43
+ mgpsogui/gui/images/test.png,sha256=MUnVpRK-isxhEHzx4Q6Yh0M6FRZD1qvgCHH2XmiSBbk,3642
44
+ mgpsogui/gui/images/trash.png,sha256=j8cf0kWbJd-4Jp20lUVV1o1NSeQ4v1Ej4gfcIA3DVRQ,2958
45
+ mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,2457
46
+ mgpsogui/util/GraphGenerator.py,sha256=dKzDPMK-0S6j1yIp5xoQIgN9GTKMhGpboAXjofCpmIk,31973
47
+ mgpsogui/util/PSORunner.py,sha256=tTe2sF9MRk48dpsNwSn_CbSSNq1laXWMxSZFh_v5FIQ,23115
48
+ mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
+ mgpsogui/util/debug.py,sha256=Swzny9_1S-CCONWGssj9iDoSpbwu5Vr4f95g_9L8bec,19759
50
+ mgpsogui/util/helpers.py,sha256=Ht2rge_4pGO7halz6KoLsL2eukB0k2tlkx68lBBmBA8,2669
51
+ mgpsogui/util/sampler_test_driver.py,sha256=1iJTLVFZ_VCsuIdl3mXQBA1GNAH5jJO3z5h4E_bd5U8,3703
52
+ mgpsogui/util/CTkToolTip/__init__.py,sha256=G1jxV55hGtGgwyC1sR-uUUdasDdh0XZgcI-aILgGYA0,225
53
+ mgpsogui/util/CTkToolTip/ctk_tooltip.py,sha256=SZMovpQIGvdpDRbqCKl9SHs92DrFCO2MOYL2ifolvOE,6329
54
+ mgpsogui/util/recosu/__init__.py,sha256=pPR0lB6clIi6q73H1W8eT5u0dd3bIemwa9-XFmOaVVk,279
55
+ mgpsogui/util/recosu/pso/__init__.py,sha256=PQ548aEKVOk6MMzxxDg7yMO_1hHfoEoYLLkGLeij73Y,247
56
+ mgpsogui/util/recosu/pso/csip_access.py,sha256=jBli1MSShUUwQCMKOUvMaGuNwBViCrjXJi_FmSEJsZA,2721
57
+ mgpsogui/util/recosu/pso/pso.py,sha256=iPqT6aI1vi8LYuWmtxuHkLEM9sQwhUznPInBgps7ANI,13708
58
+ mgpsogui/util/recosu/sampling/__init__.py,sha256=dWs1MPx0o2UFmOmUfFaomQWBTIZAwALsVJzZQNZePZU,252
59
+ mgpsogui/util/recosu/sampling/sample_trace_writer.py,sha256=M9w-POLlZgjL5a7J7yxr73OG6mCsS2aUuP9d3HKfkbA,1966
60
+ mgpsogui/util/recosu/sampling/sampler_task.py,sha256=uZobpR83u6xEaUzIknvW9FbB84c2AL7T-5T8O8QIhzY,2776
61
+ mgpsogui/util/recosu/sampling/sampling.py,sha256=9Lew9F3m4tzh1PT8EUkxkCbxs0PgfL1w2c49qtxZrXE,4174
62
+ mgpsogui/util/recosu/sampling/halton/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
+ mgpsogui/util/recosu/sampling/halton/halton.py,sha256=Vqwj3mZWcd6WS4slmIx0aA2O67Z4d6zs9haw79lhse0,1210
64
+ mgpsogui/util/recosu/sampling/halton/prime.py,sha256=gOWJWdFVthmFAt-8Utk856QlJ3IKxBvg9eDfOJOWdr0,4206
65
+ mgpsogui/util/recosu/sampling/random/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
+ mgpsogui/util/recosu/sampling/random/random_sampler.py,sha256=cVF2VA40v9h0OSBgwXCKMw4wJGaQnUfBdwVPMffk_9U,905
67
+ mgpsogui/util/recosu/utils/__init__.py,sha256=TXz_TpNif2GeGu22pzTnkUQvaP-PmLQ9Sz4BgMIS6ig,196
68
+ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvarrMRXJMbDBWqI8,3023
69
+ mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
70
+ mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
71
+ mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.3)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,110 @@
1
+ from customtkinter import CTkScrollableFrame
2
+ from customtkinter import CTkFrame
3
+ from customtkinter import CTkLabel
4
+ from customtkinter import CTkButton
5
+ from customtkinter import CTkEntry
6
+ from customtkinter import CTkOptionMenu
7
+ from tkinter import StringVar as sv
8
+ import tkinter as tk
9
+
10
+ class ParameterView(CTkScrollableFrame):
11
+ def __init__(self, *args,
12
+ option_manager: None,
13
+ list_name: None,
14
+ **kwargs):
15
+ super().__init__(*args, **kwargs)
16
+
17
+ self.option_manager = option_manager
18
+ self.list_name = list_name
19
+ self.key_values = option_manager.get_list(self.list_name)
20
+ self.edit_mode = False
21
+
22
+ self.render()
23
+
24
+ def clear(self):
25
+ self.key_values = self.option_manager.get_list(self.list_name)
26
+ self.containerFrame.destroy()
27
+
28
+ def toggle_edit_mode(self):
29
+ self.clear()
30
+ self.edit_mode = not self.edit_mode
31
+ self.render()
32
+
33
+ def render(self):
34
+ row = 0
35
+ index = 0
36
+
37
+ self.containerFrame = CTkFrame(self)
38
+ self.containerFrame.grid(row=0, column=0, padx=(5, 5), pady=(5, 5), sticky="nsew")
39
+ self.containerFrame.grid_columnconfigure((0, 1, 2, 3, 4, 5), weight=1)
40
+
41
+ #CTkLabel(self.containerFrame, text="Name:").grid(row=row, column=0, columnspan=3, padx=5, pady=5, sticky="")
42
+ #CTkLabel(self.containerFrame, text="Value:").grid(row=row, column=3, columnspan=3, padx=5, pady=5, sticky="")
43
+ #row += 1
44
+
45
+ for key_value_pair in self.key_values:
46
+ required = False
47
+ visual_name = "NONE"
48
+ if "required" in key_value_pair:
49
+ required = key_value_pair["required"].get()
50
+ if required and "visual_name" in key_value_pair:
51
+ visual_name = key_value_pair["visual_name"]
52
+
53
+ if visual_name != "NONE":
54
+ CTkLabel(self.containerFrame, text=visual_name.get()).grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="ew")
55
+ #CTkEntry(self.containerFrame, state="disabled", textvariable=self.key_values[index]["visual_name"]).grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="ew")
56
+ else:
57
+ CTkEntry(self.containerFrame, textvariable=self.key_values[index]["name"]).grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="ew")
58
+
59
+ if self.edit_mode and not required:
60
+ type_menu = CTkOptionMenu(self.containerFrame, variable=self.key_values[index]["type"], values=["integer", "float", "date", "boolean", "string"], width=20)
61
+ type_menu.grid(row=row, column=3, columnspan=1, padx=(0, 0), pady=(5, 5), sticky="ew")
62
+
63
+ dest_menu = CTkOptionMenu(self.containerFrame, variable=self.key_values[index]["destination"], values=["args", "kwargs", "conf", "options", "oh_strategy", "metainfo"], width=20)
64
+ dest_menu.grid(row=row, column=4, columnspan=1, padx=(0, 0), pady=(5, 5), sticky="ew")
65
+
66
+
67
+ return_func = lambda index=index: (self.clear(), self.option_manager.remove_key_value(self.list_name, index), self.render())
68
+
69
+ CTkButton(self.containerFrame, text="Remove", command=return_func).grid(row=row, column=5, columnspan=1, padx=(5, 5), pady=(5, 5), sticky="ew")
70
+ else:
71
+ type = self.key_values[index]["type"].get()
72
+
73
+ if type == "boolean":
74
+ bb = CTkOptionMenu(self.containerFrame, values=["True", "False", "NULL"], variable=self.key_values[index]["value"])
75
+ bb.grid(row=row, column=3, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="ew")
76
+ elif type == "date":
77
+ om_text_var = self.key_values[index]["value"]
78
+ year = sv()
79
+ month = sv()
80
+ day = sv()
81
+ vv = om_text_var.get().split("-")
82
+ year.set(vv[0])
83
+ month.set(vv[1])
84
+ day.set(vv[2])
85
+ year_options = [str(i) for i in range(1999, 2030)]
86
+ month_options = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
87
+ day_options = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"]
88
+
89
+ update_date = lambda om_text_var=om_text_var, year=year, month=month, day=day: om_text_var.set(f"{year.get()}-{month.get()}-{day.get()}")
90
+ year_menu = CTkOptionMenu(self.containerFrame, variable=year, values=year_options, width=50, command=update_date)
91
+ year_menu.grid(row=row, column=3, columnspan=1, padx=(0, 0), pady=(5, 5), sticky="ew")
92
+ month_menu = CTkOptionMenu(self.containerFrame, variable=month, values=month_options, width=20, command=update_date)
93
+ month_menu.grid(row=row, column=4, columnspan=1, padx=(0, 0), pady=(5, 5), sticky="ew")
94
+ day_menu = CTkOptionMenu(self.containerFrame, variable=day, values=day_options, width=20, command=update_date)
95
+ day_menu.grid(row=row, column=5, columnspan=1, padx=(0, 0), pady=(5, 5), sticky="ew")
96
+ else:
97
+ bb = CTkEntry(self.containerFrame)
98
+ bb.grid(row=row, column=3, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="ew")
99
+ bb.configure(textvariable=self.key_values[index]["value"])
100
+ row += 1
101
+ index += 1
102
+
103
+ if self.edit_mode:
104
+ CTkButton(self.containerFrame, text="Exit", command=self.toggle_edit_mode).grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="ew")
105
+ else:
106
+ CTkButton(self.containerFrame, text="Edit", command=self.toggle_edit_mode).grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="ew")
107
+
108
+ add_key_func = lambda: (self.clear(), self.option_manager.add_key_value(self.list_name, "name", "value"), self.render())
109
+
110
+ CTkButton(self.containerFrame, text="Add Parameter", command=add_key_func).grid(row=row, column=3, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="ew")
File without changes