Skip to content

Commit 61d4f03

Browse files
authored
Consolidate scripts and python package (#238)
* some functionality from `scripts/` would be useful inside the library * some functionality from the library was replicated in `scripts/` -> consolidate (see also #208), turn separate scripts into entrypoints (currently prefixed with `bmp-` from Benchmark-Models-Petab) * Reduce number of package configuration files * replace isort/flake/... by ruff * Problem feature table accessible through the library (closes #169) * `--help` for the overview table entrypoint * Extend overview table: add objective priors (Closes #232
1 parent 8c2290b commit 61d4f03

19 files changed

Lines changed: 443 additions & 402 deletions

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
- [ ] The model ID and model name attributes in the SBML model file match the problem name ([example](https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab/blob/3154d27edbfc4eb19b768465945bc81381a7c964/Benchmark-Models/Rahman_MBS2016/model_Rahman_MBS2016.xml#L3))
1616
- [ ] PEtab files
1717
- [ ] A "simulated data" measurement table is included, using the nominal parameters
18-
- [ ] A visualization table is included, that can be used with the simulate data to reproduce figures from the original publication
18+
- [ ] A visualization table is included, that can be used with the simulated data to reproduce figures from the original publication
1919
- [ ] The PEtab problem is valid (check with e.g. `petablint -vy problem.yaml`)
2020
- [ ] The PEtab problem author(s) are assigned to the GitHub issue
21-
- [ ] The README has been updated with `python scripts/overview.py --update`
21+
- [ ] The README has been updated with `bmp-create-overview --update` (requires `pip install -e src/python/bmp` from the repository root)
2222
- [ ] The new PEtab problem row in the generated table has the correct reference (and other entries)

.github/workflows/tests.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ jobs:
2323
run: |
2424
python -m pip install --upgrade pip
2525
pip install --upgrade setuptools wheel
26-
pip install -r scripts/requirements.txt
26+
cd src/python && pip install -e .
2727
2828
- name: Check with petablint
29-
run: ./check_petablint.py
30-
working-directory: scripts/
29+
run: bmp-petablint
3130

3231
- name: Show overview
33-
run: ./overview.py
34-
working-directory: scripts/
32+
run: bmp-create-overview
3533

3634
- name: Check SBML metadata
37-
run: ./check_sbml_metadata.py
38-
working-directory: scripts/
35+
run: bmp-check-sbml-metadata

.pre-commit-config.yaml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
11
files: src/python
22
repos:
3-
- repo: https://github.com/psf/black
4-
rev: 23.7.0
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.6.0
55
hooks:
6-
- id: black
7-
description: The uncompromising code formatter
8-
- repo: https://github.com/pycqa/isort
9-
rev: 5.12.0
6+
- id: check-yaml
7+
description: Check yaml files for parseable syntax
8+
- id: check-added-large-files
9+
description: Prevent large files from being committed
10+
- id: check-merge-conflict
11+
description: Check for files that contain merge conflict strings
12+
- id: check-symlinks
13+
description: Check for symlinks which do not point to anything
14+
- id: check-executables-have-shebangs
15+
description: Check that (non-binary) executables have shebangs
16+
- id: detect-private-key
17+
description: Detects the presence of private keys
18+
- id: end-of-file-fixer
19+
description: Fix empty lines at ends of files
20+
- id: mixed-line-ending
21+
description: Replace or check mixed line endings
22+
- id: trailing-whitespace
23+
description: Trim trailing whitespaces
24+
25+
- repo: https://github.com/astral-sh/ruff-pre-commit
26+
# Ruff version.
27+
rev: v0.6.7
1028
hooks:
11-
- id: isort
12-
name: isort
13-
- repo: https://github.com/pycqa/flake8
14-
rev: 6.0.0
15-
hooks:
16-
- id: flake8
17-
args: [--config, src/python/setup.cfg]
18-
additional_dependencies: [flake8-docstrings]
29+
# Run the linter.
30+
- id: ruff
31+
args:
32+
- --fix
33+
- --config
34+
- src/python/pyproject.toml
35+
36+
# Run the formatter.
37+
- id: ruff-format
38+
args:
39+
- --config
40+
- src/python/pyproject.toml

README.md

Lines changed: 35 additions & 35 deletions
Large diffs are not rendered by default.

scripts/_helpers.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

scripts/check_petablint.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

scripts/check_sbml_metadata.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

scripts/overview.py

Lines changed: 0 additions & 201 deletions
This file was deleted.

scripts/requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)