robert 2.2.0__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.
- robert/__init__.py +9 -0
- robert/__main__.py +20 -0
- robert/_version.py +3 -0
- robert/api.py +646 -0
- robert/aqme.py +280 -0
- robert/argument_parser.py +98 -0
- robert/checkml.py +433 -0
- robert/checkml_score.py +50 -0
- robert/curate.py +217 -0
- robert/evaluate_bot_retrieval.py +125 -0
- robert/evaluate_bot_support.py +102 -0
- robert/evaluate_workflow_summaries.py +87 -0
- robert/export_bot_docs_knowledge.py +1632 -0
- robert/generate.py +249 -0
- robert/generate_utils.py +311 -0
- robert/gui_easyrob/__init__.py +0 -0
- robert/gui_easyrob/assets/gif_easyrob.gif +0 -0
- robert/gui_easyrob/bot/__init__.py +47 -0
- robert/gui_easyrob/bot/answer_metadata.py +198 -0
- robert/gui_easyrob/bot/bot_context.py +679 -0
- robert/gui_easyrob/bot/bot_engine.py +1100 -0
- robert/gui_easyrob/bot/bot_panel.py +1231 -0
- robert/gui_easyrob/bot/bot_rag.py +1178 -0
- robert/gui_easyrob/bot/bot_window.py +39 -0
- robert/gui_easyrob/bot/bot_worker.py +149 -0
- robert/gui_easyrob/bot/credential_store.py +143 -0
- robert/gui_easyrob/bot/error_parser.py +105 -0
- robert/gui_easyrob/bot/evidence_policy.py +164 -0
- robert/gui_easyrob/bot/heuristics.py +859 -0
- robert/gui_easyrob/bot/icons.py +56 -0
- robert/gui_easyrob/bot/input_csv_audit.py +212 -0
- robert/gui_easyrob/bot/knowledge/aqme_context.json +5907 -0
- robert/gui_easyrob/bot/knowledge/robert_context.json +4817 -0
- robert/gui_easyrob/bot/knowledge/ui_context.json +8293 -0
- robert/gui_easyrob/bot/knowledge_schema.py +1252 -0
- robert/gui_easyrob/bot/knowledge_sources/aqme_user_guidance.json +442 -0
- robert/gui_easyrob/bot/knowledge_sources/coverage_manifest.json +95 -0
- robert/gui_easyrob/bot/knowledge_sources/robert_user_guidance.json +471 -0
- robert/gui_easyrob/bot/knowledge_sources/ui_user_guidance.json +1312 -0
- robert/gui_easyrob/bot/llm_providers.py +1573 -0
- robert/gui_easyrob/bot/online_docs.py +105 -0
- robert/gui_easyrob/bot/prompt_policy.py +575 -0
- robert/gui_easyrob/bot/question_intent.py +562 -0
- robert/gui_easyrob/bot/response_quality.py +104 -0
- robert/gui_easyrob/bot/result_insights.py +225 -0
- robert/gui_easyrob/bot/token_usage.py +75 -0
- robert/gui_easyrob/bot/workflow_results.py +1396 -0
- robert/gui_easyrob/checkml_launcher.py +15 -0
- robert/gui_easyrob/easyrob.py +29 -0
- robert/gui_easyrob/easyrob_launcher.py +113 -0
- robert/gui_easyrob/main/__init__.py +9 -0
- robert/gui_easyrob/main/window.py +5152 -0
- robert/gui_easyrob/result_navigation.py +14 -0
- robert/gui_easyrob/tabs/__init__.py +23 -0
- robert/gui_easyrob/tabs/advanced_options.py +370 -0
- robert/gui_easyrob/tabs/aqme.py +1234 -0
- robert/gui_easyrob/tabs/checkml.py +898 -0
- robert/gui_easyrob/tabs/images.py +427 -0
- robert/gui_easyrob/tabs/interactive_predictions.py +555 -0
- robert/gui_easyrob/tabs/molssi.py +447 -0
- robert/gui_easyrob/tabs/predictions.py +484 -0
- robert/gui_easyrob/tabs/result_catalog.py +170 -0
- robert/gui_easyrob/tabs/results.py +490 -0
- robert/gui_easyrob/tabs/results_workspace.py +120 -0
- robert/gui_easyrob/test_bot_input_csv_audit.py +152 -0
- robert/gui_easyrob/test_bot_question_routing.py +383 -0
- robert/gui_easyrob/test_bot_result_analysis.py +356 -0
- robert/gui_easyrob/test_bot_retrieval_evaluation.py +110 -0
- robert/gui_easyrob/test_bot_ui_integration.py +278 -0
- robert/gui_easyrob/test_checkml_app_mode.py +124 -0
- robert/gui_easyrob/test_checkml_completion.py +57 -0
- robert/gui_easyrob/test_checkml_defaults.py +37 -0
- robert/gui_easyrob/test_checkml_result_summary.py +113 -0
- robert/gui_easyrob/test_checkml_web_mode.py +57 -0
- robert/gui_easyrob/test_dialog_layout.py +33 -0
- robert/gui_easyrob/test_gui_bot_regressions.py +320 -0
- robert/gui_easyrob/test_molssi_auto.py +569 -0
- robert/gui_easyrob/test_tutorial_view.py +215 -0
- robert/gui_easyrob/tutorials/check_model.md +25 -0
- robert/gui_easyrob/tutorials/chemdraw.md +49 -0
- robert/gui_easyrob/tutorials/csv.md +53 -0
- robert/gui_easyrob/tutorials/descriptors.md +21 -0
- robert/gui_easyrob/tutorials/overview.md +65 -0
- robert/gui_easyrob/tutorials/predictions.md +25 -0
- robert/gui_easyrob/tutorials/robbot.md +29 -0
- robert/gui_easyrob/tutorials/tutorial_images/check_model/check_model_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/check_model/check_model_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/check_model/check_model_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/check_model/check_model_4.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/check_model/check_model_5.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/check_model/check_model_6.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/check_model/check_model_7.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_10.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_11.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_12.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_13.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_4.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_5.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_6.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_7.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_8.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/chemdraw/chemdraw_9.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_1_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_1_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_1_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_1_4.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_1_5.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_4.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_5.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_6.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_7.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_8.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/csv/csv_9.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/descriptors/descriptors_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/descriptors/descriptors_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/descriptors/descriptors_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/descriptors/descriptors_4.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/descriptors/descriptors_5.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/descriptors/descriptors_6.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_1_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_1_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_1_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_1_4.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_1_5.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_1_6.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_1_7.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_1_8.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_4.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_5.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_5_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_5_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_5_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/overview/overview_6.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/predictions/predictions_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/predictions/predictions_1_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/predictions/predictions_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/predictions/predictions_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/predictions/predictions_4.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/predictions/predictions_5.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/predictions/predictions_6.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/robbot/robbot_1.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/robbot/robbot_2.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/robbot/robbot_3.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/robbot/robbot_4.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/robbot/robbot_5.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/robbot/robbot_6.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/robbot/robbot_7.png +0 -0
- robert/gui_easyrob/tutorials/tutorial_images/robbot/robbot_8.png +0 -0
- robert/gui_easyrob/utils/__init__.py +0 -0
- robert/gui_easyrob/utils/aqme_utils.py +238 -0
- robert/gui_easyrob/utils/molssi_utils.py +584 -0
- robert/gui_easyrob/utils/predictions_utils.py +985 -0
- robert/gui_easyrob/utils/utils_gui.py +738 -0
- robert/gui_easyrob/version.py +68 -0
- robert/gui_easyrob/web/app.css +484 -0
- robert/gui_easyrob/web/app.html +134 -0
- robert/gui_easyrob/web/app.js +764 -0
- robert/gui_easyrob/web/checkml_brand.png +0 -0
- robert/gui_easyrob/web/easyrob_background.gif +0 -0
- robert/gui_easyrob/web/easyrob_background.png +0 -0
- robert/gui_easyrob/web/images.css +89 -0
- robert/gui_easyrob/web/images.html +39 -0
- robert/gui_easyrob/web/images.js +101 -0
- robert/gui_easyrob/web/results.js +499 -0
- robert/gui_easyrob/web/robert_brand.png +0 -0
- robert/gui_easyrob/web_dialogs.py +64 -0
- robert/gui_easyrob/web_results.py +253 -0
- robert/gui_easyrob/web_shell.py +684 -0
- robert/gui_easyrob/workflow_progress.py +89 -0
- robert/gui_easyrob/workflow_run_lock.py +27 -0
- robert/icons/CheckML_icon.png +0 -0
- robert/icons/Robert_icon.png +0 -0
- robert/icons/Robert_logo.jpg +0 -0
- robert/icons/Robert_logo_transparent.png +0 -0
- robert/icons/documentation_icon.png +0 -0
- robert/icons/info_icon.png +0 -0
- robert/icons/pdf_icon.png +0 -0
- robert/icons/play_icon.png +0 -0
- robert/icons/stop_icon.png +0 -0
- robert/icons/youtube_icon.ico +0 -0
- robert/predict.py +193 -0
- robert/predict_utils.py +410 -0
- robert/report/CheckML_logo.jpg +0 -0
- robert/report/GENERATE.png +0 -0
- robert/report/Robert_icon.ico +0 -0
- robert/report/Robert_logo.jpg +0 -0
- robert/report/Robert_logo1.jpg +0 -0
- robert/report/abbrev.png +0 -0
- robert/report/adv_anal.png +0 -0
- robert/report/checkml_pass.svg +3 -0
- robert/report/checkml_unclear.svg +3 -0
- robert/report/checkml_warning.svg +3 -0
- robert/report/features.png +0 -0
- robert/report/outliers.png +0 -0
- robert/report/pred.png +0 -0
- robert/report/repro.png +0 -0
- robert/report/robust_x.png +0 -0
- robert/report/robust_y_high.png +0 -0
- robert/report/robust_y_low.png +0 -0
- robert/report/score.png +0 -0
- robert/report/score_0.jpg +0 -0
- robert/report/score_1.jpg +0 -0
- robert/report/score_10.jpg +0 -0
- robert/report/score_2.jpg +0 -0
- robert/report/score_3.jpg +0 -0
- robert/report/score_4.jpg +0 -0
- robert/report/score_5.jpg +0 -0
- robert/report/score_6.jpg +0 -0
- robert/report/score_7.jpg +0 -0
- robert/report/score_8.jpg +0 -0
- robert/report/score_9.jpg +0 -0
- robert/report/score_gray_0.jpg +0 -0
- robert/report/score_gray_1.jpg +0 -0
- robert/report/score_gray_10.jpg +0 -0
- robert/report/score_gray_2.jpg +0 -0
- robert/report/score_gray_3.jpg +0 -0
- robert/report/score_gray_4.jpg +0 -0
- robert/report/score_gray_5.jpg +0 -0
- robert/report/score_gray_6.jpg +0 -0
- robert/report/score_gray_7.jpg +0 -0
- robert/report/score_gray_8.jpg +0 -0
- robert/report/score_gray_9.jpg +0 -0
- robert/report/score_w_1_0.jpg +0 -0
- robert/report/score_w_1_1.jpg +0 -0
- robert/report/score_w_2_0.jpg +0 -0
- robert/report/score_w_2_1.jpg +0 -0
- robert/report/score_w_2_2.jpg +0 -0
- robert/report/score_w_2_gray_0.jpg +0 -0
- robert/report/score_w_2_gray_1.jpg +0 -0
- robert/report/score_w_2_gray_2.jpg +0 -0
- robert/report/score_w_3_0.jpg +0 -0
- robert/report/score_w_3_1.jpg +0 -0
- robert/report/score_w_3_2.jpg +0 -0
- robert/report/score_w_3_3.jpg +0 -0
- robert/report/score_w_4_0.jpg +0 -0
- robert/report/score_w_4_1.JPG +0 -0
- robert/report/score_w_4_2.jpg +0 -0
- robert/report/score_w_4_3.jpg +0 -0
- robert/report/score_w_4_4.jpg +0 -0
- robert/report/transpa.png +0 -0
- robert/report/y_distrib.png +0 -0
- robert/report.py +2880 -0
- robert/report_utils.py +2270 -0
- robert/robert.py +181 -0
- robert/utils.py +4763 -0
- robert/verify.py +606 -0
- robert-2.2.0.dist-info/METADATA +55 -0
- robert-2.2.0.dist-info/RECORD +261 -0
- robert-2.2.0.dist-info/WHEEL +5 -0
- robert-2.2.0.dist-info/entry_points.txt +3 -0
- robert-2.2.0.dist-info/licenses/LICENSE +21 -0
- robert-2.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Pure navigation policy for the consolidated results workspace."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
RESULT_VIEW_ORDER = ("Report", "Predictions", "Images", "Interactive plots")
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def choose_available_result_view(availability, current_view, has_selection):
|
|
8
|
+
"""Keep a selected available view, or choose the first available view."""
|
|
9
|
+
if has_selection and availability.get(current_view, False):
|
|
10
|
+
return current_view
|
|
11
|
+
return next(
|
|
12
|
+
(view for view in RESULT_VIEW_ORDER if availability.get(view, False)),
|
|
13
|
+
None,
|
|
14
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Public tab components used by the easyROB main window.
|
|
2
|
+
|
|
3
|
+
The package re-exports each tab widget so the main window can assemble the
|
|
4
|
+
interface from a small, stable import surface.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .predictions import PredictionsTab
|
|
8
|
+
from .aqme import AQMETab
|
|
9
|
+
from .advanced_options import AdvancedOptionsTab
|
|
10
|
+
from .molssi import MolSSIDatabasesTab
|
|
11
|
+
from .results import ResultsTab
|
|
12
|
+
from .results_workspace import ResultsWorkspace
|
|
13
|
+
from .images import ImagesTab
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"PredictionsTab",
|
|
17
|
+
"AQMETab",
|
|
18
|
+
"AdvancedOptionsTab",
|
|
19
|
+
"MolSSIDatabasesTab",
|
|
20
|
+
"ResultsTab",
|
|
21
|
+
"ResultsWorkspace",
|
|
22
|
+
"ImagesTab",
|
|
23
|
+
]
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Advanced options tab for easyROB.
|
|
3
|
+
|
|
4
|
+
This module implements a form-based interface that allows users to configure
|
|
5
|
+
advanced parameters for different stages of the ROBERT workflow.
|
|
6
|
+
|
|
7
|
+
Each section (GENERAL, CURATE, GENERATE, PREDICT) maps directly to a stage
|
|
8
|
+
in the pipeline, enabling structured configuration without overloading the
|
|
9
|
+
main application window.
|
|
10
|
+
|
|
11
|
+
Import strategy:
|
|
12
|
+
- Supports dual execution modes:
|
|
13
|
+
1. Local (portable execution from source folder)
|
|
14
|
+
2. Installed package (environment / entry point)
|
|
15
|
+
|
|
16
|
+
- Imports use a try/except fallback:
|
|
17
|
+
local modules are attempted first, with package imports as fallback.
|
|
18
|
+
|
|
19
|
+
Notes:
|
|
20
|
+
- This module focuses purely on UI configuration.
|
|
21
|
+
- No execution logic or background processing is handled here.
|
|
22
|
+
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
# ------------------------------------------------------------
|
|
26
|
+
# Import resolution (local vs installed package)
|
|
27
|
+
# ------------------------------------------------------------
|
|
28
|
+
# Attempt local imports first (portable mode). If they fail,
|
|
29
|
+
# fall back to installed package imports.
|
|
30
|
+
try:
|
|
31
|
+
|
|
32
|
+
from utils.utils_gui import (
|
|
33
|
+
AssetLibrary,
|
|
34
|
+
QCheckBox,
|
|
35
|
+
QComboBox,
|
|
36
|
+
QDesktopServices,
|
|
37
|
+
QFormLayout,
|
|
38
|
+
QGridLayout,
|
|
39
|
+
QGroupBox,
|
|
40
|
+
QIcon,
|
|
41
|
+
QLabel,
|
|
42
|
+
QLineEdit,
|
|
43
|
+
QMessageBox,
|
|
44
|
+
QPushButton,
|
|
45
|
+
QUrl,
|
|
46
|
+
QVBoxLayout,
|
|
47
|
+
QWidget,
|
|
48
|
+
Qt,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
except ImportError as e:
|
|
52
|
+
|
|
53
|
+
from robert.gui_easyrob.utils.utils_gui import (
|
|
54
|
+
AssetLibrary,
|
|
55
|
+
QCheckBox,
|
|
56
|
+
QComboBox,
|
|
57
|
+
QDesktopServices,
|
|
58
|
+
QFormLayout,
|
|
59
|
+
QGridLayout,
|
|
60
|
+
QGroupBox,
|
|
61
|
+
QIcon,
|
|
62
|
+
QLabel,
|
|
63
|
+
QLineEdit,
|
|
64
|
+
QMessageBox,
|
|
65
|
+
QPushButton,
|
|
66
|
+
QUrl,
|
|
67
|
+
QVBoxLayout,
|
|
68
|
+
QWidget,
|
|
69
|
+
Qt,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
class AdvancedOptionsTab(QWidget):
|
|
73
|
+
"""Tab for advanced options in the easyROB application."""
|
|
74
|
+
def __init__(self, type_dropdown, tab_widget):
|
|
75
|
+
super().__init__()
|
|
76
|
+
self.type = type_dropdown
|
|
77
|
+
self.tab_widget = tab_widget # Reference to the main QTabWidget
|
|
78
|
+
main_layout = QVBoxLayout(self)
|
|
79
|
+
grid_layout = QGridLayout()
|
|
80
|
+
self.box_features = "QGroupBox { font-weight: bold; }"
|
|
81
|
+
|
|
82
|
+
# Create section boxes
|
|
83
|
+
general_box = self.create_general_section()
|
|
84
|
+
curate_box = self.create_curate_section()
|
|
85
|
+
generate_box = self.create_generate_section()
|
|
86
|
+
predict_box = self.create_predict_section()
|
|
87
|
+
|
|
88
|
+
# GENERAL (Top Row)
|
|
89
|
+
grid_layout.addWidget(general_box, 0, 0, 1, 2)
|
|
90
|
+
|
|
91
|
+
# CURATE / GENERATE (Middle Row)
|
|
92
|
+
grid_layout.addWidget(curate_box, 1, 0, 1, 1)
|
|
93
|
+
grid_layout.addWidget(generate_box, 1, 1, 1, 1)
|
|
94
|
+
|
|
95
|
+
# PREDICT (Bottom Row, Full Width)
|
|
96
|
+
grid_layout.addWidget(predict_box, 2, 0, 1, 2)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
# Add the grid layout to the main layout
|
|
100
|
+
main_layout.addLayout(grid_layout)
|
|
101
|
+
self.setLayout(main_layout)
|
|
102
|
+
|
|
103
|
+
def go_to_help_section(self, anchor):
|
|
104
|
+
"""Open a documentation section in the browser."""
|
|
105
|
+
|
|
106
|
+
base_url = "https://robert.readthedocs.io/en/latest/Technical/defaults.html"
|
|
107
|
+
|
|
108
|
+
if anchor.upper() == "GENERAL":
|
|
109
|
+
full_url = base_url
|
|
110
|
+
else:
|
|
111
|
+
full_url = f"{base_url}#{anchor.lower()}"
|
|
112
|
+
|
|
113
|
+
QDesktopServices.openUrl(QUrl(full_url))
|
|
114
|
+
|
|
115
|
+
def create_help_button(self, topic: str) -> QPushButton:
|
|
116
|
+
"""Return a styled Help button linking to documentation."""
|
|
117
|
+
|
|
118
|
+
button = QPushButton(f"Help {topic.upper()} parameters")
|
|
119
|
+
|
|
120
|
+
with AssetLibrary.Info_icon.get_path() as icon_path:
|
|
121
|
+
button.setIcon(QIcon(str(icon_path)))
|
|
122
|
+
|
|
123
|
+
button.setCursor(Qt.PointingHandCursor)
|
|
124
|
+
button.setStyleSheet("padding: 4px; font-weight: bold;")
|
|
125
|
+
|
|
126
|
+
button.clicked.connect(lambda: self.go_to_help_section(topic))
|
|
127
|
+
|
|
128
|
+
return button
|
|
129
|
+
|
|
130
|
+
def create_general_section(self):
|
|
131
|
+
"""Creates the GENERAL section box."""
|
|
132
|
+
box = QGroupBox("GENERAL")
|
|
133
|
+
box.setStyleSheet(self.box_features)
|
|
134
|
+
|
|
135
|
+
layout = QFormLayout()
|
|
136
|
+
|
|
137
|
+
self.auto_type = QCheckBox()
|
|
138
|
+
self.auto_type.setChecked(True)
|
|
139
|
+
layout.addRow(QLabel("auto_type:"), self.auto_type)
|
|
140
|
+
|
|
141
|
+
self.seed = QLineEdit()
|
|
142
|
+
self.seed.setPlaceholderText("0")
|
|
143
|
+
layout.addRow(QLabel("seed:"), self.seed)
|
|
144
|
+
|
|
145
|
+
self.kfold = QLineEdit()
|
|
146
|
+
self.kfold.setPlaceholderText("5")
|
|
147
|
+
layout.addRow(QLabel("kfold:"), self.kfold)
|
|
148
|
+
|
|
149
|
+
self.repeat_kfolds = QLineEdit()
|
|
150
|
+
self.repeat_kfolds.setPlaceholderText("10")
|
|
151
|
+
layout.addRow(QLabel("repeat_kfolds:"), self.repeat_kfolds)
|
|
152
|
+
|
|
153
|
+
self.split = QComboBox()
|
|
154
|
+
self.split.addItems([ "even", "RND", "stratified", "KN", "extra_q1", "extra_q5" ])
|
|
155
|
+
layout.addRow(QLabel("split:"), self.split)
|
|
156
|
+
|
|
157
|
+
# --- Help button at the bottom ---
|
|
158
|
+
help_button = self.create_help_button("GENERAL")
|
|
159
|
+
|
|
160
|
+
# Add with right alignment
|
|
161
|
+
layout.addRow("", help_button) # Adds it as a new row with empty label
|
|
162
|
+
layout.setAlignment(help_button, Qt.AlignRight)
|
|
163
|
+
|
|
164
|
+
box.setLayout(layout)
|
|
165
|
+
return box
|
|
166
|
+
|
|
167
|
+
def create_curate_section(self):
|
|
168
|
+
"""Creates the CURATE section with a box and input fields."""
|
|
169
|
+
box = QGroupBox("CURATE")
|
|
170
|
+
box.setStyleSheet(self.box_features)
|
|
171
|
+
layout = QFormLayout()
|
|
172
|
+
|
|
173
|
+
# Add new input fields for additional options
|
|
174
|
+
self.categoricalstr = QComboBox()
|
|
175
|
+
self.categoricalstr.addItems(["onehot", "numbers"])
|
|
176
|
+
layout.addRow(QLabel("categorical:"), self.categoricalstr)
|
|
177
|
+
|
|
178
|
+
self.corr_filter_xbool = QCheckBox()
|
|
179
|
+
self.corr_filter_xbool.setChecked(True)
|
|
180
|
+
layout.addRow(QLabel("corr_filter_x:"), self.corr_filter_xbool)
|
|
181
|
+
|
|
182
|
+
self.corr_filter_ybool = QCheckBox()
|
|
183
|
+
self.corr_filter_ybool.setChecked(False)
|
|
184
|
+
layout.addRow(QLabel("corr_filter_y:"), self.corr_filter_ybool)
|
|
185
|
+
|
|
186
|
+
self.rfecv_filterbool = QCheckBox()
|
|
187
|
+
self.rfecv_filterbool.setChecked(True)
|
|
188
|
+
layout.addRow(QLabel("rfecv_filter:"), self.rfecv_filterbool)
|
|
189
|
+
|
|
190
|
+
self.thres_xfloat = QLineEdit()
|
|
191
|
+
self.thres_xfloat.setPlaceholderText("0.7")
|
|
192
|
+
layout.addRow(QLabel("thres_x:"), self.thres_xfloat)
|
|
193
|
+
|
|
194
|
+
self.thres_yfloat = QLineEdit()
|
|
195
|
+
self.thres_yfloat.setPlaceholderText("0.001")
|
|
196
|
+
layout.addRow(QLabel("thres_y:"), self.thres_yfloat)
|
|
197
|
+
|
|
198
|
+
# --- Help button at the bottom ---
|
|
199
|
+
help_button = self.create_help_button("CURATE")
|
|
200
|
+
|
|
201
|
+
# Add with right alignment
|
|
202
|
+
layout.addRow("", help_button) # Adds it as a new row with empty label
|
|
203
|
+
layout.setAlignment(help_button, Qt.AlignRight)
|
|
204
|
+
|
|
205
|
+
box.setLayout(layout)
|
|
206
|
+
return box
|
|
207
|
+
|
|
208
|
+
def create_generate_section(self):
|
|
209
|
+
"""Creates the GENERATE section with a box and input fields."""
|
|
210
|
+
box = QGroupBox("GENERATE")
|
|
211
|
+
box.setStyleSheet(self.box_features)
|
|
212
|
+
layout = QFormLayout()
|
|
213
|
+
|
|
214
|
+
self.model_group = QGroupBox("Models")
|
|
215
|
+
self.model_layout = QGridLayout() # Grid layout for better spacing
|
|
216
|
+
self.modellist = {}
|
|
217
|
+
self.model_group.setLayout(self.model_layout)
|
|
218
|
+
layout.addRow(self.model_group)
|
|
219
|
+
|
|
220
|
+
# models restricted to a single prediction type - RF/GB/NN/GP/AdaB have both a
|
|
221
|
+
# regressor and a classifier version under the same short code, so they aren't listed
|
|
222
|
+
# here (valid for either type)
|
|
223
|
+
model_type_restriction = {
|
|
224
|
+
"MVL": "Regression",
|
|
225
|
+
"Ridge": "Regression",
|
|
226
|
+
"Logistic": "Classification",
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
def update_model_options():
|
|
230
|
+
"""Updates the model options based on the selected type."""
|
|
231
|
+
|
|
232
|
+
# Determine which models should be checked by default
|
|
233
|
+
if self.type.currentText() == "Regression":
|
|
234
|
+
default_checked_models = ["RF", "GB", "NN", "MVL"] # Regression defaults
|
|
235
|
+
else:
|
|
236
|
+
# Classification defaults: Logistic is the linear counterpart of MVL
|
|
237
|
+
default_checked_models = ["RF", "GB", "NN", "Logistic"]
|
|
238
|
+
|
|
239
|
+
# Update check states instead of recreating widgets
|
|
240
|
+
for model, checkbox in self.modellist.items():
|
|
241
|
+
checkbox.setChecked(model in default_checked_models)
|
|
242
|
+
|
|
243
|
+
def on_model_checkbox_toggled(model, checked):
|
|
244
|
+
"""Warns and immediately unchecks a model that isn't valid for the current type -
|
|
245
|
+
same restriction sanity_checks() already enforces for the CLI (--model/--type), just
|
|
246
|
+
caught here before a run is even launched instead of failing partway through."""
|
|
247
|
+
|
|
248
|
+
if not checked:
|
|
249
|
+
return
|
|
250
|
+
required_type = model_type_restriction.get(model)
|
|
251
|
+
if required_type is not None and self.type.currentText() != required_type:
|
|
252
|
+
self.modellist[model].blockSignals(True)
|
|
253
|
+
self.modellist[model].setChecked(False)
|
|
254
|
+
self.modellist[model].blockSignals(False)
|
|
255
|
+
QMessageBox.warning(
|
|
256
|
+
self, "Incompatible model",
|
|
257
|
+
f"'{model}' is only valid for {required_type.lower()}, not "
|
|
258
|
+
f"{self.type.currentText().lower()}. It has been deselected."
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
# Create checkboxes (only once) - Ridge isn't checked by default, but is available to
|
|
262
|
+
# opt into; Logistic is a classification default (see update_model_options())
|
|
263
|
+
all_models = ["RF", "MVL", "GB", "NN", "GP", "AdaB", "Ridge", "Logistic"]
|
|
264
|
+
row, col = 0, 0
|
|
265
|
+
for model in all_models:
|
|
266
|
+
checkbox = QCheckBox(model)
|
|
267
|
+
checkbox.toggled.connect(lambda checked, m=model: on_model_checkbox_toggled(m, checked))
|
|
268
|
+
self.modellist[model] = checkbox
|
|
269
|
+
self.model_layout.addWidget(checkbox, row, col)
|
|
270
|
+
|
|
271
|
+
col += 1 # Move to the next column
|
|
272
|
+
if col > 1: # Two columns max
|
|
273
|
+
col = 0
|
|
274
|
+
row += 1
|
|
275
|
+
|
|
276
|
+
# Connect signal to update check states when type changes
|
|
277
|
+
self.type.currentIndexChanged.connect(update_model_options)
|
|
278
|
+
update_model_options() # Initialize with correct models
|
|
279
|
+
|
|
280
|
+
# all_models (whether every selected model above gets its own full PDF, instead of
|
|
281
|
+
# just the best one) lives on the main screen, next to the workflow selector - it's an
|
|
282
|
+
# impactful choice (run time), not an advanced detail - see window.py's all_models_toggle
|
|
283
|
+
|
|
284
|
+
# Error type selection that changes dynamically but is also user-selectable
|
|
285
|
+
self.error_type = QComboBox()
|
|
286
|
+
layout.addRow(QLabel("error_type:"), self.error_type)
|
|
287
|
+
|
|
288
|
+
def update_error_type():
|
|
289
|
+
self.error_type.clear()
|
|
290
|
+
if self.type.currentText() == "Regression":
|
|
291
|
+
self.error_type.addItems(["rmse", "mae", "r2"])
|
|
292
|
+
else:
|
|
293
|
+
self.error_type.addItems(["mcc", "f1", "acc"])
|
|
294
|
+
|
|
295
|
+
self.type.currentIndexChanged.connect(update_error_type)
|
|
296
|
+
update_error_type() # Initialize with the correct default values
|
|
297
|
+
|
|
298
|
+
self.init_points = QLineEdit()
|
|
299
|
+
self.init_points.setPlaceholderText("10")
|
|
300
|
+
layout.addRow(QLabel("init_points:"), self.init_points)
|
|
301
|
+
|
|
302
|
+
self.n_iter = QLineEdit()
|
|
303
|
+
self.n_iter.setPlaceholderText("10")
|
|
304
|
+
layout.addRow(QLabel("n_iter:"), self.n_iter)
|
|
305
|
+
|
|
306
|
+
self.expect_improv = QLineEdit()
|
|
307
|
+
self.expect_improv.setPlaceholderText("0.05")
|
|
308
|
+
layout.addRow(QLabel("expect_improv:"), self.expect_improv)
|
|
309
|
+
|
|
310
|
+
self.pfi_filter = QCheckBox()
|
|
311
|
+
self.pfi_filter.setChecked(True)
|
|
312
|
+
layout.addRow(QLabel("pfi_filter:"), self.pfi_filter)
|
|
313
|
+
|
|
314
|
+
self.pfi_epochs = QLineEdit()
|
|
315
|
+
self.pfi_epochs.setPlaceholderText("5")
|
|
316
|
+
layout.addRow(QLabel("pfi_epochs:"), self.pfi_epochs)
|
|
317
|
+
|
|
318
|
+
self.pfi_threshold = QLineEdit()
|
|
319
|
+
self.pfi_threshold.setPlaceholderText("0.2")
|
|
320
|
+
layout.addRow(QLabel("pfi_threshold:"), self.pfi_threshold)
|
|
321
|
+
|
|
322
|
+
self.pfi_max = QLineEdit()
|
|
323
|
+
self.pfi_max.setPlaceholderText("0")
|
|
324
|
+
layout.addRow(QLabel("pfi_max:"), self.pfi_max)
|
|
325
|
+
|
|
326
|
+
self.auto_test = QCheckBox()
|
|
327
|
+
self.auto_test.setChecked(True)
|
|
328
|
+
layout.addRow(QLabel("auto_test:"), self.auto_test)
|
|
329
|
+
|
|
330
|
+
self.test_set = QLineEdit()
|
|
331
|
+
self.test_set.setPlaceholderText("0.1")
|
|
332
|
+
layout.addRow(QLabel("test_set:"), self.test_set)
|
|
333
|
+
|
|
334
|
+
# --- Help button at the bottom ---
|
|
335
|
+
help_button = self.create_help_button("GENERATE")
|
|
336
|
+
|
|
337
|
+
# Add with right alignment
|
|
338
|
+
layout.addRow("", help_button) # Adds it as a new row with empty label
|
|
339
|
+
layout.setAlignment(help_button, Qt.AlignRight)
|
|
340
|
+
|
|
341
|
+
box.setLayout(layout)
|
|
342
|
+
return box
|
|
343
|
+
|
|
344
|
+
def create_predict_section(self):
|
|
345
|
+
"""Creates the PREDICT section with a box and input fields."""
|
|
346
|
+
box = QGroupBox("PREDICT")
|
|
347
|
+
box.setStyleSheet(self.box_features)
|
|
348
|
+
layout = QFormLayout()
|
|
349
|
+
|
|
350
|
+
self.t_value = QLineEdit()
|
|
351
|
+
self.t_value.setPlaceholderText("2")
|
|
352
|
+
layout.addRow(QLabel("t_value:"), self.t_value)
|
|
353
|
+
|
|
354
|
+
self.shap_show = QLineEdit()
|
|
355
|
+
self.shap_show.setPlaceholderText("10")
|
|
356
|
+
layout.addRow(QLabel("shap_show:"), self.shap_show)
|
|
357
|
+
|
|
358
|
+
self.pfi_show = QLineEdit()
|
|
359
|
+
self.pfi_show.setPlaceholderText("10")
|
|
360
|
+
layout.addRow(QLabel("pfi_show:"), self.pfi_show)
|
|
361
|
+
|
|
362
|
+
# --- Help button at the bottom ---
|
|
363
|
+
help_button = self.create_help_button("PREDICT")
|
|
364
|
+
|
|
365
|
+
# Add with right alignment
|
|
366
|
+
layout.addRow("", help_button) # Adds it as a new row with empty label
|
|
367
|
+
layout.setAlignment(help_button, Qt.AlignRight)
|
|
368
|
+
|
|
369
|
+
box.setLayout(layout)
|
|
370
|
+
return box
|