Skip to content

v1 lint: placeholders must only be used in their own observable - #605

Merged
dweindl merged 2 commits into
PEtab-dev:mainfrom
dweindl:lint_placeholders_in_model
Nov 17, 2026
Merged

dweindl merged 2 commits into
PEtab-dev:mainfrom
dweindl:lint_placeholders_in_model

Conversation

@dweindl

@dweindl dweindl commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Placeholder parameters are overridden per measurement. Any other definition or use of the same ID conflicts with that: a model entity with the same ID would need several values within one simulation if the model uses it, a condition table column or value sets or uses a second value, and another observable or a measurement override refers to a value that is only defined for a specific measurement of the placeholder's own observable. The v1 spec doesn't state this explicitly; v2 requires placeholders to be "valid PEtab identifiers that have not been introduced elsewhere".

lint_problem now reports an error for placeholders that are model entities, condition table columns, mapping table entries or observable IDs, or that are used in another observable, the condition table or the measurement table, and for noise placeholders used in the observable formula (new assert_placeholders_only_used_in_own_observable). No problem in the benchmark collection, the PEtab v1 test suite or the doc/ examples is affected.

The Fujita example model had such parameters, plus leftover observable and noise assignment rules that PEtab didn't use. Both are removed.

🤖 Generated with Claude Code

@codecov-commenter

codecov-commenter commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.82759% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.03%. Comparing base (4329d1b) to head (d6bbbb8).

Files with missing lines Patch % Lines
petab/v1/lint.py 94.82% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #605      +/-   ##
==========================================
+ Coverage   79.93%   80.03%   +0.10%     
==========================================
  Files          70       70              
  Lines        8362     8419      +57     
  Branches     1519     1541      +22     
==========================================
+ Hits         6684     6738      +54     
- Misses       1188     1189       +1     
- Partials      490      492       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweindl dweindl changed the title v1 lint: placeholders must not be model entities v1 lint: placeholders must only be used in their own observable Nov 17, 2026
@dweindl
dweindl force-pushed the lint_placeholders_in_model branch from adf0ea5 to 97cd92a Compare November 17, 2026 11:27
@dweindl
dweindl marked this pull request as ready for review November 17, 2026 11:31
@dweindl
dweindl requested review from a team and m-philipps as code owners November 17, 2026 11:31

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.

I don't see this issue in the benchmark collection, so could check to see if this example copy is up-to-date.

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.

Yes, it's an ancient version. It wasn't synced on purpose, afair. I think this was mostly due to visualization tests for which it was used here.

dweindl and others added 2 commits November 17, 2026 15:20
Placeholder parameters are overridden per measurement. A model entity
with the same ID is a second, conflicting definition of the same
parameter. Add `assert_placeholders_not_in_model` and run it in
`lint_problem`.

Remove the leftover placeholder parameters and the unused observable
and noise assignment rules from the Fujita example model, which
violated this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extend the check to condition table columns and values, mapping table
entries, observable IDs, measurement table overrides, the use in other
observables, and noise placeholders in the observable formula. Rename
it to `assert_placeholders_only_used_in_own_observable`. Test it through
`lint_problem`, too.

List the stricter validation under breaking changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl
dweindl force-pushed the lint_placeholders_in_model branch from 97cd92a to d6bbbb8 Compare November 17, 2026 14:22
@dweindl
dweindl enabled auto-merge November 17, 2026 14:24
@dweindl
dweindl added this pull request to the merge queue Nov 17, 2026
Merged via the queue into PEtab-dev:main with commit 777c469 Nov 17, 2026
8 checks passed
@dweindl
dweindl deleted the lint_placeholders_in_model branch November 17, 2026 14:32
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.

3 participants