Skip to content

Commit 2bb9319

Browse files
authored
Add .pre-commit-config.yaml (#160)
* Add .pre-commit-config.yaml * Add some ruff ignores -- to be fixed later * Fix remaining ruff issues * Run pre-commit-hooks on GHA Closes #157
1 parent 2cd9670 commit 2bb9319

29 files changed

Lines changed: 802 additions & 653 deletions

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
merge_group:
7+
8+
jobs:
9+
quality:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out repository
13+
uses: actions/checkout@v5
14+
15+
- name: Prepare Python
16+
uses: actions/setup-python@v6
17+
with:
18+
python-version: "3.11"
19+
20+
- name: Install dependencies
21+
run: pip install pre-commit
22+
23+
- name: Run pre-commit hooks
24+
run: pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v6.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/abravalheri/validate-pyproject
12+
rev: v0.24.1
13+
hooks:
14+
- id: validate-pyproject
15+
# Optional extra validations from SchemaStore:
16+
additional_dependencies: [ "validate-pyproject-schema-store[all]" ]
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: v0.13.1
19+
hooks:
20+
- id: ruff-check
21+
types_or: [ python, pyi ]
22+
args: [ --fix ]
23+
- id: ruff-format
24+
types_or: [ python, pyi ]

.zenodo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
"Biological Modeling",
2121
"Parameter Estimation"
2222
]
23-
}
23+
}

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ The PEtabGUI provides a Python-based graphical user interface that simplifies
5252
the creation, editing, and validation of PEtab parameter estimation problems.
5353

5454
- **Unified Environment**
55-
- Integrates all PEtab components (SBML/PySB models, conditions, observables,
56-
measurements, parameters, and visualization files).
57-
- Supports drag-and-drop import of YAML or individual component files.
58-
- Automatically resolves mismatches and converts matrix-format experimental data
55+
- Integrates all PEtab components (SBML/PySB models, conditions, observables,
56+
measurements, parameters, and visualization files).
57+
- Supports drag-and-drop import of YAML or individual component files.
58+
- Automatically resolves mismatches and converts matrix-format experimental data
5959
into valid PEtab format.
6060
- **Interactive and Intuitive Editing**
61-
- Dockable, resizable, and movable table widgets for each PEtab file.
62-
- Context-aware editing with combo-boxes, drop-downs, and multi-cell editing.
63-
- Automatic generation of missing observables/conditions with customizable defaults.
64-
- Real-time validation and plausibility checks with PEtab linting tools.
65-
- SBML view in both XML and human-readable Antimony syntax.
61+
- Dockable, resizable, and movable table widgets for each PEtab file.
62+
- Context-aware editing with combo-boxes, drop-downs, and multi-cell editing.
63+
- Automatic generation of missing observables/conditions with customizable defaults.
64+
- Real-time validation and plausibility checks with PEtab linting tools.
65+
- SBML view in both XML and human-readable Antimony syntax.
6666
- **Visualization and Simulation**
6767
- Interactive plots linking measurement data with model simulations.
6868
- Bidirectional highlighting between plots and tables.
@@ -71,6 +71,6 @@ the creation, editing, and validation of PEtab parameter estimation problems.
7171
- Intelligent defaults for visualization with optional user customization.
7272
- Ability to disable plotting for large models to maintain responsiveness.
7373
- **Archiving and Export**
74-
- Export individual tables, the SBML model, or complete PEtab problems.
74+
- Export individual tables, the SBML model, or complete PEtab problems.
7575
- Save as directory structures or
7676
[COMBINE archives](https://combinearchive.org) for reproducibility

docs/source/conf.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,29 @@
1010
# -- Project information -----------------------------------------------------
1111
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1212

13-
project = 'PEtab GUI'
14-
copyright = '2025, Paul Jonas Jost, Frank T. Bergmann'
15-
author = 'Paul Jonas Jost, Frank T. Bergmann'
16-
release = '0.1.3'
13+
project = "PEtab GUI"
14+
copyright = "2025, Paul Jonas Jost, Frank T. Bergmann"
15+
author = "Paul Jonas Jost, Frank T. Bergmann"
16+
release = "0.1.3"
1717

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

2121
extensions = [
22-
'sphinx.ext.napoleon', # For Google/Numpy style docstrings
23-
'sphinx.ext.viewcode', # Add links to highlighted source code
24-
'sphinx.ext.githubpages', # For publishing on GitHub Pages
25-
'sphinx.ext.todo', # Support todo items
26-
'sphinx.ext.mathjax', # For LaTeX math rendering
27-
'myst_parser', # For Markdown support
28-
'sphinx_copybutton', # To allow copying code snippets
29-
'sphinx_design', # For better design elements
22+
"sphinx.ext.napoleon", # For Google/Numpy style docstrings
23+
"sphinx.ext.viewcode", # Add links to highlighted source code
24+
"sphinx.ext.githubpages", # For publishing on GitHub Pages
25+
"sphinx.ext.todo", # Support todo items
26+
"sphinx.ext.mathjax", # For LaTeX math rendering
27+
"myst_parser", # For Markdown support
28+
"sphinx_copybutton", # To allow copying code snippets
29+
"sphinx_design", # For better design elements
3030
]
3131

32-
templates_path = ['_templates']
32+
templates_path = ["_templates"]
3333
exclude_patterns = []
3434

3535

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

example/data_matrix.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Time,obsA,obsB,obsC
22
3, 1, 2, 3
33
5, 4, 5, 6
4-
7, 7, 8, 9
4+
7, 7, 8, 9

example/dose_response.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pApB,obsA,obsB,obsC
22
3, 1, 2, 3
33
5, 4, 5, 6
4-
7, 7, 8, 9
4+
7, 7, 8, 9

example/meas.tsv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ rSTAT5A_rel model1_data1 41.0627332148332 100.0 sd_rSTAT5A_rel model1_data1_rS
4646
rSTAT5A_rel model1_data1 39.2358300289377 120.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel
4747
rSTAT5A_rel model1_data1 36.6194605442418 160.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel
4848
rSTAT5A_rel model1_data1 34.8937144010561 200.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel
49-
rSTAT5A_rel model1_data1 32.2110771608676 240.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel
49+
rSTAT5A_rel model1_data1 32.2110771608676 240.0 sd_rSTAT5A_rel model1_data1_rSTAT5A_rel

example/problem.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ problems:
88
observable_files:
99
- obs.tsv
1010
sbml_files:
11-
- sbml_model.xml
11+
- sbml_model.xml

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,26 @@ lint.ignore = [
8484
"D100", # Ignore missing docstring in public modules
8585
"D101", # Ignore missing docstring in public classes
8686
"F401",
87+
# FIXME: those are ignored for now, should be fixed eventually
88+
"E501", # Ignore line too long
89+
"ERA001", # Found commented-out code
90+
"RET504", # Unnecessary assignment before `return`
91+
"T201", # `print` found"
92+
"SIM105", # Use `contextlib.suppress`
93+
"S110", # `try`-`except`-`pass` detected, consider logging the exception
94+
"A002", # Function argument shadowing a Python builtin
95+
"E701", # Multiple statements on one line (colon)
96+
"E741", # Ambiguous variable name
8797
]
8898
[tool.ruff.lint.per-file-ignores]
8999
"*/__init__.py" = [
90100
"F401",
91101
"D400",
92102
"D205",
93103
]
104+
"docs/source/conf.py" = [
105+
"A001", # Variable `copyright` is shadowing a Python builtin
106+
107+
]
94108
[tool.ruff.lint.pydocstyle]
95109
convention = "pep257"

0 commit comments

Comments
 (0)