Skip to content

Commit 34ab483

Browse files
committed
Changes to content to match next Steps tutorial
1 parent 12410a5 commit 34ab483

File tree

2 files changed

+60
-20
lines changed

2 files changed

+60
-20
lines changed

src/petab_gui/controllers/mother_controller.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,11 @@ def save_model(self):
596596
)
597597

598598
# Show next steps panel if not disabled
599-
if not settings_manager.get_value(
599+
dont_show = settings_manager.get_value(
600600
"next_steps/dont_show_again", False, bool
601-
):
601+
)
602+
if not dont_show:
603+
self.next_steps_panel.set_dont_show_again(dont_show)
602604
self.next_steps_panel.show_panel()
603605

604606
return True
@@ -1435,6 +1437,11 @@ def about(self):
14351437

14361438
def _show_next_steps_panel(self):
14371439
"""Show the next steps panel (ignores 'don't show again' preference)."""
1440+
# Sync checkbox state with current settings
1441+
dont_show = settings_manager.get_value(
1442+
"next_steps/dont_show_again", False, bool
1443+
)
1444+
self.next_steps_panel.set_dont_show_again(dont_show)
14381445
self.next_steps_panel.show_panel()
14391446

14401447
def _handle_next_steps_dont_show_again(self, dont_show: bool):

src/petab_gui/views/other_views.py

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
QPushButton,
1313
QTextBrowser,
1414
QVBoxLayout,
15-
QWidget,
1615
)
1716

1817

@@ -64,21 +63,22 @@ def __init__(
6463
btns.addWidget(ok)
6564
lay.addLayout(btns)
6665

67-
def get_result(self) -> tuple[str | None, str | None]:
66+
def get_result(self) -> tuple[str | None, str | None, str]:
6867
dose = self._dose.currentText() or None
6968
time_text = (self._time.text() or "").strip() or None
7069
preeq = (self._preeq_edit.text() or "").strip()
7170
return dose, time_text, preeq
7271

7372

74-
class NextStepsPanel(QWidget):
73+
class NextStepsPanel(QDialog):
7574
"""Non-modal panel showing possible next steps after saving."""
7675

7776
dont_show_again_changed = Signal(bool)
7877

7978
def __init__(self, parent=None):
80-
super().__init__(parent, Qt.Window | Qt.WindowStaysOnTopHint)
79+
super().__init__(parent)
8180
self.setWindowTitle("Possible next steps")
81+
self.setModal(False)
8282
self.setMinimumWidth(450)
8383
self.setMaximumWidth(600)
8484
self.setMinimumHeight(360)
@@ -99,6 +99,36 @@ def __init__(self, parent=None):
9999
suggestions_layout = QVBoxLayout()
100100
suggestions_layout.setSpacing(8)
101101

102+
# Benchmark Collection action
103+
benchmark_frame = QFrame()
104+
benchmark_frame.setStyleSheet(
105+
"QFrame { background-color: rgba(255, 193, 7, 0.08); "
106+
"border-radius: 4px; padding: 8px; }"
107+
)
108+
benchmark_layout = QVBoxLayout(benchmark_frame)
109+
benchmark_layout.setContentsMargins(8, 8, 8, 8)
110+
benchmark_layout.setSpacing(4)
111+
112+
benchmark_text = QTextBrowser()
113+
benchmark_text.setOpenExternalLinks(True)
114+
benchmark_text.setFrameStyle(QFrame.NoFrame)
115+
benchmark_text.setStyleSheet(
116+
"QTextBrowser { background: transparent; }"
117+
)
118+
benchmark_text.setVerticalScrollBarPolicy(
119+
Qt.ScrollBarPolicy.ScrollBarAlwaysOff
120+
)
121+
benchmark_text.setHtml(
122+
'<p style="margin:0; line-height:1.3;">'
123+
"<b>📚 Contribute to Benchmark Collection</b><br/>"
124+
"Share your PEtab problem with the community to validate it, "
125+
"enable reproducibility, and support benchmarking<br/>"
126+
'<a href="https://github.com/Benchmarking-Initiative/'
127+
'Benchmark-Models-PEtab">Benchmark Collection</a></p>'
128+
)
129+
benchmark_layout.addWidget(benchmark_text)
130+
suggestions_layout.addWidget(benchmark_frame)
131+
102132
# pyPESTO action
103133
pypesto_frame = QFrame()
104134
pypesto_frame.setStyleSheet(
@@ -118,9 +148,9 @@ def __init__(self, parent=None):
118148
)
119149
pypesto_text.setHtml(
120150
'<p style="margin:0; line-height:1.3;">'
121-
"<b>▶ Parameter estimation</b><br/>"
122-
"Use pyPESTO for parameter estimation and uncertainty "
123-
"analysis<br/>"
151+
"<b>▶ Parameter Estimation with pyPESTO</b><br/>"
152+
"Use pyPESTO for parameter estimation, uncertainty analysis, "
153+
"and model selection<br/>"
124154
'<a href="https://pypesto.readthedocs.io/en/latest/example/'
125155
'petab_import.html">pyPESTO documentation</a></p>'
126156
)
@@ -146,9 +176,9 @@ def __init__(self, parent=None):
146176
)
147177
copasi_text.setHtml(
148178
'<p style="margin:0; line-height:1.3;">'
149-
"<b>⚙ Model adjustment and simulation</b><br/>"
179+
"<b>⚙ Advanced Model Adaptation and Simulation</b><br/>"
150180
"Use COPASI for further model adjustment and advanced "
151-
"simulation<br/>"
181+
"simulation with a graphical interface<br/>"
152182
'<a href="https://copasi.org">COPASI website</a></p>'
153183
)
154184
copasi_layout.addWidget(copasi_text)
@@ -202,14 +232,15 @@ def __init__(self, parent=None):
202232
'<li style="margin-bottom: 4px;">'
203233
'<a href="https://amici.readthedocs.io/en/latest/examples/'
204234
'example_petab/petab.html">AMICI</a> - '
205-
"Advanced simulation and sensitivity analysis</li>"
235+
"Efficient simulation and sensitivity analysis</li>"
236+
'<li style="margin-bottom: 4px;">'
237+
'<a href="https://sebapersson.github.io/PEtab.jl/stable/">'
238+
"PEtab.jl</a> - "
239+
"High-performance Julia parameter estimation</li>"
206240
'<li style="margin-bottom: 4px;">'
207241
'<a href="https://github.com/Data2Dynamics/d2d/wiki">'
208242
"Data2Dynamics</a> - "
209-
"Comprehensive modeling environment</li>"
210-
'<li style="margin-bottom: 4px;">'
211-
'<a href="https://parpe.readthedocs.io">parPE</a> - '
212-
"Parallel parameter estimation</li>"
243+
"MATLAB-based comprehensive modeling framework</li>"
213244
'<li style="margin-bottom: 4px;">'
214245
'<a href="https://petab.readthedocs.io/en/latest/v1/'
215246
'software_support.html">PEtab documentation</a> - '
@@ -237,10 +268,8 @@ def __init__(self, parent=None):
237268
bottom_layout.setSpacing(8)
238269

239270
self._dont_show_checkbox = QCheckBox("Don't show after saving")
240-
self._dont_show_checkbox.stateChanged.connect(
241-
lambda state: self.dont_show_again_changed.emit(
242-
state == Qt.CheckState.Checked
243-
)
271+
self._dont_show_checkbox.toggled.connect(
272+
self.dont_show_again_changed.emit
244273
)
245274
bottom_layout.addWidget(self._dont_show_checkbox)
246275

@@ -265,6 +294,10 @@ def _toggle_other_tools(self, checked):
265294
# Adjust window size
266295
self.adjustSize()
267296

297+
def set_dont_show_again(self, dont_show: bool):
298+
"""Set the 'don't show again' checkbox state."""
299+
self._dont_show_checkbox.setChecked(dont_show)
300+
268301
def show_panel(self):
269302
"""Show the panel and center it on the parent."""
270303
if self.parent():

0 commit comments

Comments
 (0)