Skip to content

Commit 0490808

Browse files
committed
Merge branch 'develop' into screenshot
# Conflicts: # README.md
2 parents 32e2f40 + e6b622d commit 0490808

10 files changed

Lines changed: 72 additions & 12 deletions

File tree

.readthedocs.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,3 @@ build:
2727
# Avoid setuptools-scm dirty Git index issues
2828
- git reset --hard HEAD
2929
- git clean -fdx
30-
# Enforce fail_on_shallow for setuptools-scm
31-
- export SETUPTOOLS_SCM_OVERRIDES_FOR_${READTHEDOCS_PROJECT//-/_}='{scm.git.pre_parse="fail_on_shallow"}'

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
[![PyPI - Version](https://badge.fury.io/py/PEtab-GUI.svg)](https://pypi.org/project/PEtab-GUI/)
12
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15355753.svg)](https://doi.org/10.5281/zenodo.15355753)
2-
# PEtabGUI
33

4+
# PEtabGUI
45

56
PEtabGUI provides a graphical user interface to inspect and edit parameter
67
estimation problems encoded in the
@@ -16,6 +17,13 @@ To install PEtabGUI from [PyPI](https://pypi.org/project/PEtab-GUI/), run:
1617
pip install petab_gui
1718
```
1819

20+
or, to install PEtabGUI in a dedicated virtual environment using
21+
[pipx](https://github.com/pypa/pipx) (to be installed separately), run:
22+
23+
```bash
24+
pipx install petab_gui
25+
```
26+
1927
### From GitHub
2028

2129
To install the latest development version from GitHub, run:
@@ -50,6 +58,17 @@ When launching with a problem, PEtabGUI will look like this (up to the position
5058
widgets):
5159
![PEtabGUI Screenshot](https://raw.githubusercontent.com/PaulJonasJost/PEtab_GUI/screenshot/docs/source/_static/Application_Screenshot.png)
5260

61+
### Examples
62+
63+
A set of real-world PEtab problems is available in the
64+
[PEtab benchmark collection](https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab).
65+
66+
Download and unpack the [archive](https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab/archive/refs/heads/master.zip),
67+
then open one of the YAML files inside `Benchmark-Models/*/` using
68+
PEtabGUI.
69+
`Benchmark-Models/Boehm_JProteomeRes2014/Boehm_JProteomeRes2014.yaml`
70+
should serve as a good starting point.
71+
5372
## Features
5473

5574
The PEtabGUI provides a Python-based graphical user interface that simplifies

docs/source/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
55
from importlib.metadata import version as get_version
66

7-
rst_prolog = """
8-
.. |petab_doc_url| replace:: https://petab.readthedocs.io/en/latest/index.html
9-
"""
10-
117
# -- Project information -----------------------------------------------------
128
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
139

@@ -33,6 +29,10 @@
3329
templates_path = ["_templates"]
3430
exclude_patterns = []
3531

32+
rst_prolog = f"""
33+
.. |petab_doc_url| replace:: https://petab.readthedocs.io/en/latest/index.html
34+
.. |release| replace:: {release}
35+
"""
3636

3737
# -- Options for HTML output -------------------------------------------------
3838
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PEtab GUI - A graphical user interface for PEtab
1818
**PEtab GUI** is a user-friendly graphical interface for creating and managing parameter estimation problems using the `PEtab <https://petab.readthedocs.io/en/latest/>`_ format.
1919

2020
.. note::
21-
Current version: 0.1.3
21+
Current version: |release|
2222

2323
Quick Links
2424
-----------

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ dependencies = [
2121
"petab[combine]>=0.6.0",
2222
"qtawesome",
2323
"copasi-basico",
24-
"copasi-petab-importer"
24+
"copasi-petab-importer",
25+
"pyobjc; sys_platform == 'darwin'"
2526
]
2627
license-files = ["LICENSE"]
2728

src/petab_gui/C.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
import numpy as np
44

5+
#: Application name
6+
APP_NAME = "PEtabGUI"
7+
#: Base URL of the repository
8+
REPO_URL = "https://github.com/PaulJonasJost/PEtab_GUI"
9+
510
COLUMNS = {
611
"measurement": {
712
"observableId": {"type": np.object_, "optional": False},

src/petab_gui/app.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from PySide6.QtGui import QFileOpenEvent, QIcon
1010
from PySide6.QtWidgets import QApplication
1111

12+
from .C import APP_NAME
1213
from .controllers import MainController
1314
from .models import PEtabModel
1415
from .views import MainWindow
@@ -59,6 +60,7 @@ def __init__(self, file: str | Path = None):
5960
"""
6061
super().__init__(sys.argv)
6162

63+
self.setApplicationName(APP_NAME)
6264
self.setWindowIcon(get_icon())
6365
self.model = PEtabModel()
6466
self.view = MainWindow()
@@ -120,7 +122,7 @@ def main():
120122
except PackageNotFoundError:
121123
pkg_version = "unknown"
122124

123-
parser = argparse.ArgumentParser(description="PEtabGUI: A PEtab editor")
125+
parser = argparse.ArgumentParser(description=f"{APP_NAME}: A PEtab editor")
124126
parser.add_argument(
125127
"--version",
126128
action="version",
@@ -132,6 +134,13 @@ def main():
132134
)
133135
args = parser.parse_args()
134136

137+
if sys.platform == "darwin":
138+
from Foundation import NSBundle # type: type: ignore[import]
139+
140+
bundle = NSBundle.mainBundle()
141+
info = bundle.localizedInfoDictionary() or bundle.infoDictionary()
142+
info["CFBundleName"] = APP_NAME
143+
135144
app = PEtabGuiApp(args.petab_yaml)
136145
sys.exit(app.exec())
137146

src/petab_gui/controllers/mother_controller.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import tempfile
55
import zipfile
66
from functools import partial
7+
from importlib.metadata import version
78
from io import BytesIO
89
from pathlib import Path
910

@@ -32,6 +33,7 @@
3233
QWidget,
3334
)
3435

36+
from ..C import APP_NAME, REPO_URL
3537
from ..models import PEtabModel, SbmlViewerModel
3638
from ..settings_manager import SettingsDialog, settings_manager
3739
from ..utils import (
@@ -164,7 +166,7 @@ def window_title(self):
164166
"""Return the window title based on the model."""
165167
if isinstance(self.model.sbml, SbmlViewerModel):
166168
return self.model.sbml.model_id
167-
return "PEtab Editor"
169+
return APP_NAME
168170

169171
def setup_context_menu(self):
170172
"""Sets up context menus for the tables."""
@@ -438,6 +440,12 @@ def setup_actions(self):
438440
self._whats_this_filter = _WhatsThisClickHelp(actions["whats_this"])
439441
actions["whats_this"].toggled.connect(self._toggle_whats_this_mode)
440442

443+
# About action
444+
actions["about"] = QAction(
445+
qta.icon("mdi6.information"), "&About", self.view
446+
)
447+
actions["about"].triggered.connect(self.about)
448+
441449
# connect actions
442450
actions["reset_view"] = QAction(
443451
qta.icon("mdi6.view-grid-plus"), "Reset View", self.view
@@ -1158,6 +1166,24 @@ def _show_help_welcome(self):
11581166
if dont.isChecked():
11591167
settings.setValue("help_mode/welcome_disabled", True)
11601168

1169+
def about(self):
1170+
"""Show an about dialog."""
1171+
config_file = settings_manager.settings.fileName()
1172+
QMessageBox.about(
1173+
self.view,
1174+
f"About {APP_NAME}",
1175+
f"<b>{APP_NAME}</b><br>"
1176+
f"Version: {version('petab-gui')}<br>"
1177+
f"PEtab version: {version('petab')}<br><br>"
1178+
f"{APP_NAME} is a tool for editing and visualizing PEtab "
1179+
f"problems.<br><br>"
1180+
f"Visit the GitHub repository at "
1181+
f"<a href='{REPO_URL}'>{REPO_URL}</a> "
1182+
"for more information.<br><br>"
1183+
f"<small>Settings are stored in "
1184+
f"<a href='file://{config_file}'>{config_file}</a></small>",
1185+
)
1186+
11611187
def get_current_problem(self):
11621188
"""Get the current PEtab problem from the model."""
11631189
return self.model.current_petab_problem

src/petab_gui/views/main_view.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
QWidget,
1313
)
1414

15+
from ..C import APP_NAME
1516
from ..models.tooltips import (
1617
COND_TABLE_TOOLTIP,
1718
DATA_PLOT_TOOLTIP,
@@ -39,7 +40,7 @@ def __init__(self):
3940

4041
self.allow_close = False
4142

42-
self.setWindowTitle("PEtabGUI")
43+
self.setWindowTitle(APP_NAME)
4344
self.setGeometry(100, 100, 1200, 800)
4445

4546
# Logger: used in both tabs

src/petab_gui/views/task_bar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def __init__(self, parent, actions):
137137
# Add actions to the menu for re-adding tables
138138
self.menu.addAction(actions["open_documentation"])
139139
self.menu.addAction(actions["whats_this"])
140+
self.menu.addAction(actions["about"])
140141

141142

142143
class TaskBar:

0 commit comments

Comments
 (0)