Restructure problem directories into problems/<id>/v1/ + resources/ - #326
Conversation
Move Benchmark-Models/<ProblemID>/ to problems/<ProblemID>/v1/, standardizing filenames to the short form (problem.yaml, model.xml, conditions.tsv, measurements.tsv, observables.tsv, parameters.tsv, and the optional simulations.tsv/visualizations.tsv). This separates the PEtab files from provenance/background material, which now lives in an optional problems/<ProblemID>/resources/, and prepares each problem directory for a future sibling v2/ format. Non-PEtab and non-canonical material (anything not referenced by a problem's YAML) moves into resources/, e.g. General_info.xlsx, petab_select/, per-figure visualization tables, and other variant/ alternate problem definitions. Update base.py, C.py, overview.py, MANIFEST.in, build.sh, the simulate.yml CI job, .gitignore, CONTRIBUTING.md, and the PR template for the new paths and filenames, and regenerate the README overview table. Closes Benchmarking-Initiative#324 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The rename script rewrote each v1/problem.yaml on disk to reference the new short filenames, but never re-staged that rewrite, so the previous commit captured the old, pre-rename filenames inside these YAML files. Fix the content to match the actual files on disk. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Not sure about what the policy is or should be for adding all those additional things, but I am in favor of having only the petab-yaml-referenced files in the problems//v1/ directory (plus potentially some additional structured information file later on). For all those other files, it's not immediately clear where they should be used. For now, I would just move them to resources/. If we also want to have a model selection benchmark collection, we should probably decide now if that's supposed to be included in this repo (and if so how we would separate the basic parameter estimation problems from model selection problems). |
Fine for me.
Agreed. There is no plan for a model selection benchmark collection currently. The additional curation of e.g. alternative formulations and model selection problems are useful but out-of-scope of benchmarking PEtab, so I would suggest we just keep them unstructured inside |
Works for. README.md is probably more helpful. I'd keep that for a later PR. |
dilpath
left a comment
There was a problem hiding this comment.
Thanks!
I guess the Fujita alternative formulations are now broken. Ideally:
- every PEtab problem YAML everywhere (including in
resources/) can be loaded/is a valid problem when loaded - every v1/problem.yaml produces the same simulated data as in simulations.tsv, as some kind of validation that nothing broke during the restructure. Also the alternative formulations if it's easy (e.g. compare the simulation with the simulation generated by the repo commit before the restructure).
| run: | | ||
| for problem in `ls -1 Benchmark-Models/`; do | ||
| for problem in `ls -1 problems/`; do | ||
| python src/python/simulate.py "$problem" -j |
There was a problem hiding this comment.
Rename to simulate_v1.py?
There was a problem hiding this comment.
I'd do that separately with other v2-related updates.
| - [ ] Files are placed under `problems/<ProblemID>/v1/` (`problem.yaml`, `model.xml`, `conditions.tsv`, | ||
| `measurements.tsv`, `observables.tsv`, `parameters.tsv`, `simulations.tsv`, `visualizations.tsv`); | ||
| any other material (raw data, scripts, notebooks, ...) goes in `problems/<ProblemID>/resources/` |
There was a problem hiding this comment.
Until now, this template looks v1/v2 agnostic, but fine to keep
There was a problem hiding this comment.
Right. For now, only making space to accommodate a v2 tree later on. v2 policy, documentation, and code support to be added later.
| yaml_path = Path(MODELS_DIR, id_, id_ + ".yaml") | ||
| if not yaml_path.exists(): | ||
| yaml_path = Path(MODELS_DIR, id_, "problem.yaml") | ||
| yaml_path = Path(MODELS_DIR, id_, "v1", "problem.yaml") |
There was a problem hiding this comment.
V1 = "v1"? PROBLEM_FILENAME = "problem.yaml"? MEASUREMENTS_FILENAME = "measurements.tsv"?
There was a problem hiding this comment.
Why is this symlink useful? Fine to keep
There was a problem hiding this comment.
Just renaming it. This was added 4 years ago (#167). This is currently required for editable installations of the Python package to work.
| *egg-info | ||
| src/python/build | ||
| Benchmark-Models/Smith_BMCSystBiol2013/amici_models/* | ||
| problems/Smith_BMCSystBiol2013/v1/amici_models/* |
There was a problem hiding this comment.
Strange to have this in particular... gitignore any amici_models directory?
There was a problem hiding this comment.
Indeed. Added 3 years ago (#180). I'll replace it by a flat amici_models.
Agreed. One argument for a YAML is that it would be easy to check via CI that every file inside resources is at least described. |
Ideally, there wouldn't be any alternative formulations 🙈 .
I can add that.
That's out of scope for me. This whole simulation table setup is a mess (see also #278, #279, #280), and I don't think this should block adding v2 problems. |
That is true, but I think it's tedious to describe every single file if it's already part of a petab problem. For the current state of I thin, I'd prefer a human-readable readme with a high-level overview instead of a machine readable file-by-file description. |
Thanks!
I think that's fine. The point is to ensure no problem was broken somehow due to the restructure. The "validation" through AMICI ( https://github.com/AMICI-dev/AMICI/blob/main/tests/benchmark_models/benchmark_models.yaml ) is sufficient for me to ensure nothing was broken, although that doesn't include all models. |
I think you're right overall, fine for me to go with a README then. These things will probably all be generated anyway. |
dilpath
left a comment
There was a problem hiding this comment.
Thanks!
Feel free to merge once you're somewhat confident that the problems haven't changed due to the restructure.
Turns out that this will require a bit more thought. There is for example |
Ah, I just meant as a one-off check to ensure the restructure didn't break anything. Not that we need to add something to CI. i.e. just to make sure real additional problems, like provided for Fujita, are still valid after the restructure. And agreed, fine to ignore the "intentionally invalid" things like the Blasi template. |
Add bmp-check-petab-yaml: walks problems/ for any YAML file that looks like a PEtab v1 problem (has format_version and problems keys) and validates it with petablint. This catches broken supplementary problem definitions anywhere under a problem's resources/, not just the canonical MODELS. Wire it into the tests.yml CI job as an informational, non-blocking step for now, since it also surfaces a few pre-existing, unrelated data issues that are out of scope here. Fix the relative file references in resources. Flush stdout around each petablint subprocess call in both check_petablint.py and check_petab_yaml.py, since unflushed, buffered print() output otherwise gets reordered relative to the subprocess's own output when stdout isn't a tty, as in CI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
17897b9 to
8a3b1a7
Compare
🤖 Generated with Claude Code
Restructures each problem's directory to prepare for PEtab v2 support (each problem can later get a sibling
v2/) and to separate benchmarking files from background/provenance material.Benchmark-Models/<ProblemID>/becomes:Filenames are standardized to the short form
Bertozzi_PNAS2020already used. The canonical file set for each problem was determined by parsing its ownproblem.yaml(rather than hand-coded per problem), so this is mechanical and driven by what's actually referenced.Everything not referenced by a problem's YAML moved into
resources/, e.g.General_info.xlsx,petab_select/, README files, and things not explicitly called out in the issue but following the same rule: per-figure visualization tables (Lucarelli, Raimundez, Sneyd), and alternate/variant sub-problems (Fiedler'sreformulated/, Fujita'stest_data/, Liu'sindividual-based/, Oliveira'sBahia/, Smith'ssim_test/, Zhao's held-out test split + orphaned second YAML, Blasi's unused_allCombinationsmodel variant).Also updated for the new paths/filenames:
base.py,C.py,overview.py,MANIFEST.in,build.sh,.gitignore, thesimulate.ymlCI job,CONTRIBUTING.md, and the PR template. The README overview table was regenerated withbmp-create-overview --update.Closes #324