Skip to content

Commit

Permalink
Consolidate scripts and python package (#238)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dweindl authored Sep 30, 2024
1 parent 8c2290b commit 61d4f03
Show file tree
Hide file tree
Showing 19 changed files with 443 additions and 402 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
- [ ] 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))
- [ ] PEtab files
- [ ] A "simulated data" measurement table is included, using the nominal parameters
- [ ] A visualization table is included, that can be used with the simulate data to reproduce figures from the original publication
- [ ] A visualization table is included, that can be used with the simulated data to reproduce figures from the original publication
- [ ] The PEtab problem is valid (check with e.g. `petablint -vy problem.yaml`)
- [ ] The PEtab problem author(s) are assigned to the GitHub issue
- [ ] The README has been updated with `python scripts/overview.py --update`
- [ ] The README has been updated with `bmp-create-overview --update` (requires `pip install -e src/python/bmp` from the repository root)
- [ ] The new PEtab problem row in the generated table has the correct reference (and other entries)
11 changes: 4 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel
pip install -r scripts/requirements.txt
cd src/python && pip install -e .
- name: Check with petablint
run: ./check_petablint.py
working-directory: scripts/
run: bmp-petablint

- name: Show overview
run: ./overview.py
working-directory: scripts/
run: bmp-create-overview

- name: Check SBML metadata
run: ./check_sbml_metadata.py
working-directory: scripts/
run: bmp-check-sbml-metadata
50 changes: 36 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
files: src/python
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: black
description: The uncompromising code formatter
- repo: https://github.com/pycqa/isort
rev: 5.12.0
- id: check-yaml
description: Check yaml files for parseable syntax
- id: check-added-large-files
description: Prevent large files from being committed
- id: check-merge-conflict
description: Check for files that contain merge conflict strings
- id: check-symlinks
description: Check for symlinks which do not point to anything
- id: check-executables-have-shebangs
description: Check that (non-binary) executables have shebangs
- id: detect-private-key
description: Detects the presence of private keys
- id: end-of-file-fixer
description: Fix empty lines at ends of files
- id: mixed-line-ending
description: Replace or check mixed line endings
- id: trailing-whitespace
description: Trim trailing whitespaces

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.7
hooks:
- id: isort
name: isort
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: [--config, src/python/setup.cfg]
additional_dependencies: [flake8-docstrings]
# Run the linter.
- id: ruff
args:
- --fix
- --config
- src/python/pyproject.toml

# Run the formatter.
- id: ruff-format
args:
- --config
- src/python/pyproject.toml
70 changes: 35 additions & 35 deletions README.md

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions scripts/_helpers.py

This file was deleted.

25 changes: 0 additions & 25 deletions scripts/check_petablint.py

This file was deleted.

51 changes: 0 additions & 51 deletions scripts/check_sbml_metadata.py

This file was deleted.

201 changes: 0 additions & 201 deletions scripts/overview.py

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/requirements.txt

This file was deleted.

Loading

0 comments on commit 61d4f03

Please sign in to comment.