Skip to content

Prepare library API and docs for PEtab v2 problems - #328

Merged
dweindl merged 3 commits into
PEtab-dev:masterfrom
dweindl:prep-v2-groundwork
Oct 14, 2026
Merged

dweindl merged 3 commits into
PEtab-dev:masterfrom
dweindl:prep-v2-groundwork

Conversation

@dweindl

@dweindl dweindl commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Closes #327.

Prepares benchmark_models_petab and the repo docs so that problems/<id>/v2/ directories can be added later without further groundwork. No v2/ problem directory is created here — that's separate, later work.

  • Splits library access into benchmark_models_petab.v1 / .v2 submodules, mirroring petab.v1/petab.v2. Each exposes get_problem, get_problem_yaml_path, get_simulation_df. Top-level get_problem etc. keep their current (v1) behavior unchanged (base.py/test_base.py renamed to v1.py/test_v1.py).
  • v2.get_problem_yaml_path/get_problem raise a clear error when a problem has no v2/ yet (the normal case for essentially every problem right now).
  • Documents the v1/v2 equivalence policy in CONTRIBUTING.md: a problem's v1/ and v2/ encodings must represent exactly the same mathematical problem (same model, data, objective), though v2/ files may look structurally different to make idiomatic use of v2 features. For problems with priors (MAP estimation), the policy is not decided yet: v1 priors on log-scaled parameters cannot, in general, be expressed as v2 priors without changing either the optimum or the prior distribution; CONTRIBUTING.md notes this and refers to v1/v2 equivalence of problems with priors on log-scaled parameters #333.
  • Adds an optional PR-template checklist item pointing at that policy.
  • Both v1/ and v2/ are documented as optional (at least one must be present), rather than implying v1/ is mandatory.

Out of scope, left for follow-up work: generating/hand-curating any actual problems/<id>/v2/ directory, an automated v1-vs-v2 equivalence checker, and updating the README overview table / INSTALL.md usage docs for v2 (postponed until real v2 problems exist).

🤖 Drafted with AI assistance

Comment thread CONTRIBUTING.md
Comment on lines +16 to +17
A problem's `v1/` and `v2/` encodings must represent *exactly* the same mathematical problem:
same model, same data, same objective.

@dweindl dweindl Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably need some refinement. How do we want to deal with the whole parameter scaling topic? Encode it in the model or condition table, ignore it, ...? -> #333

Split benchmark_models_petab access into v1/v2 submodules mirroring
petab.v1/petab.v2, so a later piece of work can add problems/<id>/v2/
directories without further library or docs groundwork. Top-level
get_problem/get_problem_yaml_path/get_simulation_df keep their current
(v1) behavior unchanged.

Also documents the v1/v2 equivalence policy in CONTRIBUTING.md and adds
a corresponding optional PR-template checklist item. For problems with
priors, the policy is not decided yet; this is noted with a reference
to PEtab-dev#333.

References PEtab-dev#327.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dweindl
dweindl force-pushed the prep-v2-groundwork branch from 0541ebc to 537a970 Compare October 13, 2026 20:45
@dweindl
dweindl marked this pull request as ready for review October 13, 2026 20:49

@dilpath dilpath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread src/python/benchmark_models_petab/v2.py Resolved
Comment thread src/python/benchmark_models_petab/v1.py Resolved
dweindl and others added 2 commits October 14, 2026 10:53
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
Re-format with ruff and drop the trailing space from the v2 error
message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl
dweindl merged commit 86a46dd into PEtab-dev:master Oct 14, 2026
3 checks passed
@dweindl
dweindl deleted the prep-v2-groundwork branch October 14, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prepare library API and docs for PEtab v2 problems

2 participants