Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI
on:
push:
pull_request:
workflow_dispatch:
merge_group:

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5

- name: Prepare Python
uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install dependencies
run: pip install pre-commit

- name: Run pre-commit hooks
run: pre-commit run --all-files
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
- id: validate-pyproject
# Optional extra validations from SchemaStore:
additional_dependencies: [ "validate-pyproject-schema-store[all]" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.1
hooks:
- id: ruff-check
types_or: [ python, pyi ]
args: [ --fix ]
- id: ruff-format
types_or: [ python, pyi ]
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
"Biological Modeling",
"Parameter Estimation"
]
}
}
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ The PEtabGUI provides a Python-based graphical user interface that simplifies
the creation, editing, and validation of PEtab parameter estimation problems.

- **Unified Environment**
- Integrates all PEtab components (SBML/PySB models, conditions, observables,
measurements, parameters, and visualization files).
- Supports drag-and-drop import of YAML or individual component files.
- Automatically resolves mismatches and converts matrix-format experimental data
- Integrates all PEtab components (SBML/PySB models, conditions, observables,
measurements, parameters, and visualization files).
- Supports drag-and-drop import of YAML or individual component files.
- Automatically resolves mismatches and converts matrix-format experimental data
into valid PEtab format.
- **Interactive and Intuitive Editing**
- Dockable, resizable, and movable table widgets for each PEtab file.
- Context-aware editing with combo-boxes, drop-downs, and multi-cell editing.
- Automatic generation of missing observables/conditions with customizable defaults.
- Real-time validation and plausibility checks with PEtab linting tools.
- SBML view in both XML and human-readable Antimony syntax.
- Dockable, resizable, and movable table widgets for each PEtab file.
- Context-aware editing with combo-boxes, drop-downs, and multi-cell editing.
- Automatic generation of missing observables/conditions with customizable defaults.
- Real-time validation and plausibility checks with PEtab linting tools.
- SBML view in both XML and human-readable Antimony syntax.
- **Visualization and Simulation**
- Interactive plots linking measurement data with model simulations.
- Bidirectional highlighting between plots and tables.
Expand All @@ -71,6 +71,6 @@ the creation, editing, and validation of PEtab parameter estimation problems.
- Intelligent defaults for visualization with optional user customization.
- Ability to disable plotting for large models to maintain responsiveness.
- **Archiving and Export**
- Export individual tables, the SBML model, or complete PEtab problems.
- Export individual tables, the SBML model, or complete PEtab problems.
- Save as directory structures or
[COMBINE archives](https://combinearchive.org) for reproducibility
27 changes: 13 additions & 14 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,29 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'PEtab GUI'
copyright = '2025, Paul Jonas Jost, Frank T. Bergmann'
author = 'Paul Jonas Jost, Frank T. Bergmann'
release = '0.1.3'
project = "PEtab GUI"
copyright = "2025, Paul Jonas Jost, Frank T. Bergmann"
author = "Paul Jonas Jost, Frank T. Bergmann"
release = "0.1.3"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.napoleon', # For Google/Numpy style docstrings
'sphinx.ext.viewcode', # Add links to highlighted source code
'sphinx.ext.githubpages', # For publishing on GitHub Pages
'sphinx.ext.todo', # Support todo items
'sphinx.ext.mathjax', # For LaTeX math rendering
'myst_parser', # For Markdown support
'sphinx_copybutton', # To allow copying code snippets
'sphinx_design', # For better design elements
"sphinx.ext.napoleon", # For Google/Numpy style docstrings
"sphinx.ext.viewcode", # Add links to highlighted source code
"sphinx.ext.githubpages", # For publishing on GitHub Pages
"sphinx.ext.todo", # Support todo items
"sphinx.ext.mathjax", # For LaTeX math rendering
"myst_parser", # For Markdown support
"sphinx_copybutton", # To allow copying code snippets
"sphinx_design", # For better design elements
]

templates_path = ['_templates']
templates_path = ["_templates"]
exclude_patterns = []



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

Expand Down
2 changes: 1 addition & 1 deletion example/data_matrix.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Time,obsA,obsB,obsC
3, 1, 2, 3
5, 4, 5, 6
7, 7, 8, 9
7, 7, 8, 9
2 changes: 1 addition & 1 deletion example/dose_response.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pApB,obsA,obsB,obsC
3, 1, 2, 3
5, 4, 5, 6
7, 7, 8, 9
7, 7, 8, 9
2 changes: 1 addition & 1 deletion example/meas.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ rSTAT5A_rel model1_data1 41.0627332148332 100.0 sd_rSTAT5A_rel model1_data1_rS
rSTAT5A_rel model1_data1 39.2358300289377 120.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel
rSTAT5A_rel model1_data1 36.6194605442418 160.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel
rSTAT5A_rel model1_data1 34.8937144010561 200.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel
rSTAT5A_rel model1_data1 32.2110771608676 240.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel
rSTAT5A_rel model1_data1 32.2110771608676 240.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel
2 changes: 1 addition & 1 deletion example/problem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ problems:
observable_files:
- obs.tsv
sbml_files:
- sbml_model.xml
- sbml_model.xml
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,26 @@ lint.ignore = [
"D100", # Ignore missing docstring in public modules
"D101", # Ignore missing docstring in public classes
"F401",
# FIXME: those are ignored for now, should be fixed eventually
"E501", # Ignore line too long
"ERA001", # Found commented-out code
"RET504", # Unnecessary assignment before `return`
"T201", # `print` found"
"SIM105", # Use `contextlib.suppress`
"S110", # `try`-`except`-`pass` detected, consider logging the exception
"A002", # Function argument shadowing a Python builtin
"E701", # Multiple statements on one line (colon)
"E741", # Ambiguous variable name
]
[tool.ruff.lint.per-file-ignores]
"*/__init__.py" = [
"F401",
"D400",
"D205",
]
"docs/source/conf.py" = [
"A001", # Variable `copyright` is shadowing a Python builtin

]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
2 changes: 1 addition & 1 deletion src/petab_gui/C.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"yLabel": {"type": np.object_, "optional": True},
"yScale": {"type": np.object_, "optional": True},
"legendEntry": {"type": np.object_, "optional": True},
}
},
}

CONFIG = {
Expand Down
10 changes: 4 additions & 6 deletions src/petab_gui/app.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import argparse
import os
import sys
from importlib.metadata import PackageNotFoundError, version
from importlib.resources import files
from importlib.metadata import version, PackageNotFoundError
from pathlib import Path

from PySide6.QtCore import QEvent
Expand Down Expand Up @@ -48,7 +48,7 @@ class PEtabGuiApp(QApplication):
Inherits from QApplication and sets up the MVC components.
"""

def __init__(self, file: str|Path = None):
def __init__(self, file: str | Path = None):
"""Initialize the PEtab GUI application.

Sets up the model, view, and controller components.
Expand Down Expand Up @@ -125,12 +125,10 @@ def main():
"--version",
action="version",
version=f"%(prog)s {pkg_version}",
help="Show version number and exit"
help="Show version number and exit",
)
parser.add_argument(
"petab_yaml",
nargs="?",
help="Path to the PEtab YAML file"
"petab_yaml", nargs="?", help="Path to the PEtab YAML file"
)
args = parser.parse_args()

Expand Down
11 changes: 5 additions & 6 deletions src/petab_gui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def redo(self):
df = self.model._data_frame

if self.add_mode:
position = 0 if df.empty else df.shape[0] - 1 # insert *before* the auto-row
position = (
0 if df.empty else df.shape[0] - 1
) # insert *before* the auto-row
self.model.beginInsertRows(
QModelIndex(), position, position + len(self.row_indices) - 1
)
Expand Down Expand Up @@ -264,12 +266,9 @@ def _apply_changes(self, use_new: bool):
else:
df[col] = df[col].astype(dtype)

rows = [
df.index.get_loc(row_key) for (row_key, _) in self.changes
]
rows = [df.index.get_loc(row_key) for (row_key, _) in self.changes]
cols = [
df.columns.get_loc(col) + col_offset
for (_, col) in self.changes
df.columns.get_loc(col) + col_offset for (_, col) in self.changes
]

top_left = self.model.index(min(rows), min(cols))
Expand Down
4 changes: 2 additions & 2 deletions src/petab_gui/controllers/logger_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def __init__(self, views):
self.logger_level = 1
self.log_message("Welcome to PEtab-GUI!", color="green")
self.log_message(
'If you need help, click <b>Help</b> in the menu,'
' enter the Help Mode (click question mark in toolbar) or visit '
"If you need help, click <b>Help</b> in the menu,"
" enter the Help Mode (click question mark in toolbar) or visit "
'the <a href="https://petab-gui.readthedocs.io/en/latest/" '
'style="color:blue;" target="_blank">documentation</a>.',
color="green",
Expand Down
Loading