workbench 0.8.174__py3-none-any.whl → 0.8.227__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 workbench might be problematic. Click here for more details.

Files changed (145) hide show
  1. workbench/__init__.py +1 -0
  2. workbench/algorithms/dataframe/__init__.py +1 -2
  3. workbench/algorithms/dataframe/compound_dataset_overlap.py +321 -0
  4. workbench/algorithms/dataframe/feature_space_proximity.py +168 -75
  5. workbench/algorithms/dataframe/fingerprint_proximity.py +422 -86
  6. workbench/algorithms/dataframe/projection_2d.py +44 -21
  7. workbench/algorithms/dataframe/proximity.py +259 -305
  8. workbench/algorithms/graph/light/proximity_graph.py +12 -11
  9. workbench/algorithms/models/cleanlab_model.py +382 -0
  10. workbench/algorithms/models/noise_model.py +388 -0
  11. workbench/algorithms/sql/column_stats.py +0 -1
  12. workbench/algorithms/sql/correlations.py +0 -1
  13. workbench/algorithms/sql/descriptive_stats.py +0 -1
  14. workbench/algorithms/sql/outliers.py +3 -3
  15. workbench/api/__init__.py +5 -1
  16. workbench/api/df_store.py +17 -108
  17. workbench/api/endpoint.py +14 -12
  18. workbench/api/feature_set.py +117 -11
  19. workbench/api/meta.py +0 -1
  20. workbench/api/meta_model.py +289 -0
  21. workbench/api/model.py +52 -21
  22. workbench/api/parameter_store.py +3 -52
  23. workbench/cached/cached_meta.py +0 -1
  24. workbench/cached/cached_model.py +49 -11
  25. workbench/core/artifacts/__init__.py +11 -2
  26. workbench/core/artifacts/artifact.py +7 -7
  27. workbench/core/artifacts/data_capture_core.py +8 -1
  28. workbench/core/artifacts/df_store_core.py +114 -0
  29. workbench/core/artifacts/endpoint_core.py +323 -205
  30. workbench/core/artifacts/feature_set_core.py +249 -45
  31. workbench/core/artifacts/model_core.py +133 -101
  32. workbench/core/artifacts/parameter_store_core.py +98 -0
  33. workbench/core/cloud_platform/aws/aws_account_clamp.py +48 -2
  34. workbench/core/cloud_platform/cloud_meta.py +0 -1
  35. workbench/core/pipelines/pipeline_executor.py +1 -1
  36. workbench/core/transforms/features_to_model/features_to_model.py +60 -44
  37. workbench/core/transforms/model_to_endpoint/model_to_endpoint.py +43 -10
  38. workbench/core/transforms/pandas_transforms/pandas_to_features.py +38 -2
  39. workbench/core/views/training_view.py +113 -42
  40. workbench/core/views/view.py +53 -3
  41. workbench/core/views/view_utils.py +4 -4
  42. workbench/model_script_utils/model_script_utils.py +339 -0
  43. workbench/model_script_utils/pytorch_utils.py +405 -0
  44. workbench/model_script_utils/uq_harness.py +277 -0
  45. workbench/model_scripts/chemprop/chemprop.template +774 -0
  46. workbench/model_scripts/chemprop/generated_model_script.py +774 -0
  47. workbench/model_scripts/chemprop/model_script_utils.py +339 -0
  48. workbench/model_scripts/chemprop/requirements.txt +3 -0
  49. workbench/model_scripts/custom_models/chem_info/fingerprints.py +175 -0
  50. workbench/model_scripts/custom_models/chem_info/mol_descriptors.py +18 -7
  51. workbench/model_scripts/custom_models/chem_info/mol_standardize.py +80 -58
  52. workbench/model_scripts/custom_models/chem_info/molecular_descriptors.py +0 -1
  53. workbench/model_scripts/custom_models/chem_info/morgan_fingerprints.py +1 -2
  54. workbench/model_scripts/custom_models/proximity/feature_space_proximity.py +194 -0
  55. workbench/model_scripts/custom_models/proximity/feature_space_proximity.template +8 -10
  56. workbench/model_scripts/custom_models/uq_models/bayesian_ridge.template +7 -8
  57. workbench/model_scripts/custom_models/uq_models/ensemble_xgb.template +20 -21
  58. workbench/model_scripts/custom_models/uq_models/feature_space_proximity.py +194 -0
  59. workbench/model_scripts/custom_models/uq_models/gaussian_process.template +5 -11
  60. workbench/model_scripts/custom_models/uq_models/ngboost.template +15 -16
  61. workbench/model_scripts/ensemble_xgb/ensemble_xgb.template +15 -17
  62. workbench/model_scripts/meta_model/generated_model_script.py +209 -0
  63. workbench/model_scripts/meta_model/meta_model.template +209 -0
  64. workbench/model_scripts/pytorch_model/generated_model_script.py +443 -499
  65. workbench/model_scripts/pytorch_model/model_script_utils.py +339 -0
  66. workbench/model_scripts/pytorch_model/pytorch.template +440 -496
  67. workbench/model_scripts/pytorch_model/pytorch_utils.py +405 -0
  68. workbench/model_scripts/pytorch_model/requirements.txt +1 -1
  69. workbench/model_scripts/pytorch_model/uq_harness.py +277 -0
  70. workbench/model_scripts/scikit_learn/generated_model_script.py +7 -12
  71. workbench/model_scripts/scikit_learn/scikit_learn.template +4 -9
  72. workbench/model_scripts/script_generation.py +15 -12
  73. workbench/model_scripts/uq_models/generated_model_script.py +248 -0
  74. workbench/model_scripts/xgb_model/generated_model_script.py +371 -403
  75. workbench/model_scripts/xgb_model/model_script_utils.py +339 -0
  76. workbench/model_scripts/xgb_model/uq_harness.py +277 -0
  77. workbench/model_scripts/xgb_model/xgb_model.template +367 -399
  78. workbench/repl/workbench_shell.py +18 -14
  79. workbench/resources/open_source_api.key +1 -1
  80. workbench/scripts/endpoint_test.py +162 -0
  81. workbench/scripts/lambda_test.py +73 -0
  82. workbench/scripts/meta_model_sim.py +35 -0
  83. workbench/scripts/ml_pipeline_sqs.py +122 -6
  84. workbench/scripts/training_test.py +85 -0
  85. workbench/themes/dark/custom.css +59 -0
  86. workbench/themes/dark/plotly.json +5 -5
  87. workbench/themes/light/custom.css +153 -40
  88. workbench/themes/light/plotly.json +9 -9
  89. workbench/themes/midnight_blue/custom.css +59 -0
  90. workbench/utils/aws_utils.py +0 -1
  91. workbench/utils/chem_utils/fingerprints.py +87 -46
  92. workbench/utils/chem_utils/mol_descriptors.py +18 -7
  93. workbench/utils/chem_utils/mol_standardize.py +80 -58
  94. workbench/utils/chem_utils/projections.py +16 -6
  95. workbench/utils/chem_utils/vis.py +25 -27
  96. workbench/utils/chemprop_utils.py +141 -0
  97. workbench/utils/config_manager.py +2 -6
  98. workbench/utils/endpoint_utils.py +5 -7
  99. workbench/utils/license_manager.py +2 -6
  100. workbench/utils/markdown_utils.py +57 -0
  101. workbench/utils/meta_model_simulator.py +499 -0
  102. workbench/utils/metrics_utils.py +256 -0
  103. workbench/utils/model_utils.py +274 -87
  104. workbench/utils/pipeline_utils.py +0 -1
  105. workbench/utils/plot_utils.py +159 -34
  106. workbench/utils/pytorch_utils.py +87 -0
  107. workbench/utils/shap_utils.py +11 -57
  108. workbench/utils/theme_manager.py +95 -30
  109. workbench/utils/xgboost_local_crossfold.py +267 -0
  110. workbench/utils/xgboost_model_utils.py +127 -220
  111. workbench/web_interface/components/experiments/outlier_plot.py +0 -1
  112. workbench/web_interface/components/model_plot.py +16 -2
  113. workbench/web_interface/components/plugin_unit_test.py +5 -3
  114. workbench/web_interface/components/plugins/ag_table.py +2 -4
  115. workbench/web_interface/components/plugins/confusion_matrix.py +3 -6
  116. workbench/web_interface/components/plugins/model_details.py +48 -80
  117. workbench/web_interface/components/plugins/scatter_plot.py +192 -92
  118. workbench/web_interface/components/settings_menu.py +184 -0
  119. workbench/web_interface/page_views/main_page.py +0 -1
  120. {workbench-0.8.174.dist-info → workbench-0.8.227.dist-info}/METADATA +31 -17
  121. {workbench-0.8.174.dist-info → workbench-0.8.227.dist-info}/RECORD +125 -111
  122. {workbench-0.8.174.dist-info → workbench-0.8.227.dist-info}/entry_points.txt +4 -0
  123. {workbench-0.8.174.dist-info → workbench-0.8.227.dist-info}/licenses/LICENSE +1 -1
  124. workbench/core/cloud_platform/aws/aws_df_store.py +0 -404
  125. workbench/core/cloud_platform/aws/aws_parameter_store.py +0 -280
  126. workbench/model_scripts/custom_models/meta_endpoints/example.py +0 -53
  127. workbench/model_scripts/custom_models/proximity/generated_model_script.py +0 -138
  128. workbench/model_scripts/custom_models/proximity/proximity.py +0 -384
  129. workbench/model_scripts/custom_models/uq_models/generated_model_script.py +0 -393
  130. workbench/model_scripts/custom_models/uq_models/mapie.template +0 -502
  131. workbench/model_scripts/custom_models/uq_models/meta_uq.template +0 -386
  132. workbench/model_scripts/custom_models/uq_models/proximity.py +0 -384
  133. workbench/model_scripts/ensemble_xgb/generated_model_script.py +0 -279
  134. workbench/model_scripts/quant_regression/quant_regression.template +0 -279
  135. workbench/model_scripts/quant_regression/requirements.txt +0 -1
  136. workbench/themes/quartz/base_css.url +0 -1
  137. workbench/themes/quartz/custom.css +0 -117
  138. workbench/themes/quartz/plotly.json +0 -642
  139. workbench/themes/quartz_dark/base_css.url +0 -1
  140. workbench/themes/quartz_dark/custom.css +0 -131
  141. workbench/themes/quartz_dark/plotly.json +0 -642
  142. workbench/utils/fast_inference.py +0 -167
  143. workbench/utils/resource_utils.py +0 -39
  144. {workbench-0.8.174.dist-info → workbench-0.8.227.dist-info}/WHEEL +0 -0
  145. {workbench-0.8.174.dist-info → workbench-0.8.227.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,184 @@
1
+ """SettingsMenu: A settings menu component for the Workbench Dashboard."""
2
+
3
+ from dash import html, dcc
4
+ import dash_bootstrap_components as dbc
5
+
6
+ # Workbench Imports
7
+ from workbench.utils.theme_manager import ThemeManager
8
+
9
+
10
+ class SettingsMenu:
11
+ """A settings menu with admin links and theme selection."""
12
+
13
+ def __init__(self):
14
+ """Initialize the SettingsMenu."""
15
+ self.tm = ThemeManager()
16
+
17
+ def create_component(self, component_id: str) -> html.Div:
18
+ """Create a settings menu dropdown component.
19
+
20
+ Args:
21
+ component_id (str): The ID prefix for the component.
22
+
23
+ Returns:
24
+ html.Div: A Div containing the settings menu dropdown.
25
+ """
26
+ themes = self.tm.list_themes()
27
+
28
+ # Create theme submenu items
29
+ theme_items = []
30
+ for theme in sorted(themes):
31
+ theme_items.append(
32
+ dbc.DropdownMenuItem(
33
+ [
34
+ html.Span(
35
+ "",
36
+ id={"type": f"{component_id}-checkmark", "theme": theme},
37
+ style={
38
+ "fontFamily": "monospace",
39
+ "marginRight": "5px",
40
+ "width": "20px",
41
+ "display": "inline-block",
42
+ },
43
+ ),
44
+ theme.replace("_", " ").title(),
45
+ ],
46
+ id={"type": f"{component_id}-theme-item", "theme": theme},
47
+ )
48
+ )
49
+
50
+ # Hamburger icon (3 rounded lines)
51
+ hamburger_icon = html.Div(
52
+ [
53
+ html.Div(
54
+ style={
55
+ "width": "20px",
56
+ "height": "3px",
57
+ "backgroundColor": "currentColor",
58
+ "borderRadius": "2px",
59
+ "marginBottom": "4px",
60
+ }
61
+ ),
62
+ html.Div(
63
+ style={
64
+ "width": "20px",
65
+ "height": "3px",
66
+ "backgroundColor": "currentColor",
67
+ "borderRadius": "2px",
68
+ "marginBottom": "4px",
69
+ }
70
+ ),
71
+ html.Div(
72
+ style={"width": "20px", "height": "3px", "backgroundColor": "currentColor", "borderRadius": "2px"}
73
+ ),
74
+ ],
75
+ style={"display": "flex", "flexDirection": "column", "alignItems": "center", "justifyContent": "center"},
76
+ )
77
+
78
+ # Build menu items: Status, License, divider, Themes submenu
79
+ menu_items = [
80
+ dbc.DropdownMenuItem("Status", href="/status", external_link=True, target="_blank"),
81
+ dbc.DropdownMenuItem("License", href="/license", external_link=True, target="_blank"),
82
+ dbc.DropdownMenuItem(divider=True),
83
+ dbc.DropdownMenuItem("Themes", header=True),
84
+ *theme_items,
85
+ ]
86
+
87
+ return html.Div(
88
+ [
89
+ dbc.DropdownMenu(
90
+ label=hamburger_icon,
91
+ children=menu_items,
92
+ id=f"{component_id}-dropdown",
93
+ toggle_style={
94
+ "background": "transparent",
95
+ "border": "none",
96
+ "boxShadow": "none",
97
+ "padding": "5px 10px",
98
+ },
99
+ caret=False,
100
+ align_end=True,
101
+ ),
102
+ # Dummy store for the clientside callback output
103
+ dcc.Store(id=f"{component_id}-dummy", data=None),
104
+ # Store to trigger checkmark update on load
105
+ dcc.Store(id=f"{component_id}-init", data=True),
106
+ ],
107
+ id=component_id,
108
+ )
109
+
110
+ @staticmethod
111
+ def get_clientside_callback_code(component_id: str) -> str:
112
+ """Get the JavaScript code for the theme selection clientside callback.
113
+
114
+ Args:
115
+ component_id (str): The ID prefix used in create_component.
116
+
117
+ Returns:
118
+ str: JavaScript code for the clientside callback.
119
+ """
120
+ return """
121
+ function(n_clicks_list, ids) {
122
+ // Find which button was clicked
123
+ if (!n_clicks_list || n_clicks_list.every(n => !n)) {
124
+ return window.dash_clientside.no_update;
125
+ }
126
+
127
+ // Find the clicked theme
128
+ let clickedTheme = null;
129
+ for (let i = 0; i < n_clicks_list.length; i++) {
130
+ if (n_clicks_list[i]) {
131
+ clickedTheme = ids[i].theme;
132
+ break;
133
+ }
134
+ }
135
+
136
+ if (clickedTheme) {
137
+ // Store in localStorage
138
+ localStorage.setItem('wb_theme', clickedTheme);
139
+ // Set cookie for Flask to read on reload
140
+ document.cookie = `wb_theme=${clickedTheme}; path=/; max-age=31536000`;
141
+ // Reload the page to apply the new theme
142
+ window.location.reload();
143
+ }
144
+
145
+ return window.dash_clientside.no_update;
146
+ }
147
+ """
148
+
149
+ @staticmethod
150
+ def get_checkmark_callback_code() -> str:
151
+ """Get the JavaScript code to update checkmarks based on localStorage.
152
+
153
+ Returns:
154
+ str: JavaScript code for the checkmark update callback.
155
+ """
156
+ return """
157
+ function(init, ids) {
158
+ // Get current theme from localStorage (or cookie as fallback)
159
+ let currentTheme = localStorage.getItem('wb_theme');
160
+ if (!currentTheme) {
161
+ // Try to read from cookie
162
+ const cookies = document.cookie.split(';');
163
+ for (let cookie of cookies) {
164
+ const [name, value] = cookie.trim().split('=');
165
+ if (name === 'wb_theme') {
166
+ currentTheme = value;
167
+ break;
168
+ }
169
+ }
170
+ }
171
+
172
+ // Return checkmarks for each theme
173
+ return ids.map(id => id.theme === currentTheme ? '\u2713' : '');
174
+ }
175
+ """
176
+
177
+
178
+ if __name__ == "__main__":
179
+ # Quick test to verify component creation
180
+ menu = SettingsMenu()
181
+ component = menu.create_component("test-settings-menu")
182
+ print("SettingsMenu component created successfully")
183
+ print(f"Available themes: {menu.tm.list_themes()}")
184
+ print(f"Current theme: {menu.tm.current_theme()}")
@@ -3,7 +3,6 @@
3
3
  import pandas as pd
4
4
  from typing import Optional, Tuple
5
5
 
6
-
7
6
  # Workbench Imports
8
7
  from workbench.web_interface.page_views.page_view import PageView
9
8
  from workbench.utils.symbols import tag_symbols
@@ -1,15 +1,37 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: workbench
3
- Version: 0.8.174
3
+ Version: 0.8.227
4
4
  Summary: Workbench: A Dashboard and Python API for creating and deploying AWS SageMaker Model Pipelines
5
5
  Author-email: SuperCowPowers LLC <support@supercowpowers.com>
6
- License-Expression: MIT
6
+ License: MIT License
7
+
8
+ Copyright (c) 2021-2026 SuperCowPowers LLC
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
7
28
  Project-URL: Homepage, https://github.com/SuperCowPowers/workbench
8
29
  Keywords: SageMaker,Machine Learning,AWS,Python,Utilities
9
30
  Classifier: Development Status :: 4 - Beta
10
31
  Classifier: Programming Language :: Python :: 3.10
11
32
  Classifier: Programming Language :: Python :: 3.11
12
33
  Classifier: Programming Language :: Python :: 3.12
34
+ Classifier: Programming Language :: Python :: 3.13
13
35
  Classifier: Topic :: Scientific/Engineering
14
36
  Requires-Python: >=3.10
15
37
  Description-Content-Type: text/markdown
@@ -20,20 +42,22 @@ Requires-Dist: redis>=5.0.1
20
42
  Requires-Dist: numpy>=1.26.4
21
43
  Requires-Dist: pandas>=2.2.1
22
44
  Requires-Dist: awswrangler>=3.4.0
23
- Requires-Dist: sagemaker>=2.143
45
+ Requires-Dist: sagemaker<3.0,>=2.143
24
46
  Requires-Dist: cryptography>=44.0.2
25
47
  Requires-Dist: ipython>=8.37.0
26
48
  Requires-Dist: pyreadline3; sys_platform == "win32"
27
49
  Requires-Dist: scikit-learn>=1.5.2
50
+ Requires-Dist: umap-learn>=0.5.8
28
51
  Requires-Dist: xgboost>=3.0.3
29
52
  Requires-Dist: joblib>=1.3.2
30
53
  Requires-Dist: requests>=2.26.0
31
54
  Requires-Dist: rdkit>=2024.9.5
32
55
  Requires-Dist: mordredcommunity>=2.0.6
33
- Requires-Dist: workbench-bridges>=0.1.10
56
+ Requires-Dist: workbench-bridges>=0.1.16
57
+ Requires-Dist: cleanlab>=2.9.0
34
58
  Provides-Extra: ui
35
59
  Requires-Dist: plotly>=6.0.0; extra == "ui"
36
- Requires-Dist: dash>3.0.0; extra == "ui"
60
+ Requires-Dist: dash>=3.0.0; extra == "ui"
37
61
  Requires-Dist: dash-bootstrap-components>=1.6.0; extra == "ui"
38
62
  Requires-Dist: dash-bootstrap-templates>=1.3.0; extra == "ui"
39
63
  Requires-Dist: dash_ag_grid; extra == "ui"
@@ -48,18 +72,8 @@ Requires-Dist: flake8; extra == "dev"
48
72
  Requires-Dist: black; extra == "dev"
49
73
  Provides-Extra: all
50
74
  Requires-Dist: networkx>=3.2; extra == "all"
51
- Requires-Dist: plotly>=5.18.0; extra == "all"
52
- Requires-Dist: dash<3.0.0,>=2.16.1; extra == "all"
53
- Requires-Dist: dash-bootstrap-components>=1.6.0; extra == "all"
54
- Requires-Dist: dash-bootstrap-templates>=1.3.0; extra == "all"
55
- Requires-Dist: dash_ag_grid; extra == "all"
56
- Requires-Dist: tabulate>=0.9.0; extra == "all"
57
- Requires-Dist: pytest; extra == "all"
58
- Requires-Dist: pytest-sugar; extra == "all"
59
- Requires-Dist: coverage; extra == "all"
60
- Requires-Dist: pytest-cov; extra == "all"
61
- Requires-Dist: flake8; extra == "all"
62
- Requires-Dist: black; extra == "all"
75
+ Requires-Dist: workbench[ui]; extra == "all"
76
+ Requires-Dist: workbench[dev]; extra == "all"
63
77
  Dynamic: license-file
64
78
 
65
79