Skip to content

v2 lint: warn about unused placeholders - #599

Merged
dweindl merged 1 commit into
PEtab-dev:mainfrom
dweindl:v2_lint_unused_placeholders
Nov 17, 2026
Merged

dweindl merged 1 commit into
PEtab-dev:mainfrom
dweindl:v2_lint_unused_placeholders

Conversation

@dweindl

@dweindl dweindl commented Nov 16, 2026

Copy link
Copy Markdown
Member

Adds CheckUnusedPlaceholders to the default v2 validation tasks. It emits a warning for

  • entries of observablePlaceholders that are used in neither observableFormula nor noiseFormula (observable placeholders are allowed in the noise formula),
  • entries of noisePlaceholders that are not used in noiseFormula.

The spec allows declaring placeholders that are not used, so this is a warning, not an error. Usage is determined from the sympified formulas, so a placeholder that cancels out (e.g. x + p - p) is reported as unused.

Closes #587.

🤖 Generated with Claude Code

@dweindl
dweindl force-pushed the v2_lint_unused_placeholders branch from ece6e56 to bf53e2c Compare November 16, 2026 20:54
@codecov-commenter

codecov-commenter commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.78%. Comparing base (b45a01c) to head (0cd6659).

Files with missing lines Patch % Lines
petab/v2/lint.py 90.90% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #599      +/-   ##
==========================================
+ Coverage   79.75%   79.78%   +0.02%     
==========================================
  Files          70       70              
  Lines        8332     8354      +22     
  Branches     1510     1515       +5     
==========================================
+ Hits         6645     6665      +20     
- Misses       1197     1198       +1     
- Partials      490      491       +1     

☔ 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 self-assigned this Nov 17, 2026
@dweindl
dweindl force-pushed the v2_lint_unused_placeholders branch from bf53e2c to 094d3e3 Compare November 17, 2026 07:35
@dweindl
dweindl marked this pull request as ready for review November 17, 2026 07:42
@dweindl
dweindl requested a review from a team as a code owner November 17, 2026 07:42
@dweindl
dweindl force-pushed the v2_lint_unused_placeholders branch from 094d3e3 to 0ba8e38 Compare November 17, 2026 07:53
Add `CheckUnusedPlaceholders` to the default validation tasks. It warns
about entries of `observablePlaceholders` that are used in neither
`observableFormula` nor `noiseFormula`, and about entries of
`noisePlaceholders` that are not used in `noiseFormula`.

Closes PEtab-dev#587.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl
dweindl force-pushed the v2_lint_unused_placeholders branch from 0ba8e38 to 0cd6659 Compare November 17, 2026 13:47
@dweindl
dweindl added this pull request to the merge queue Nov 17, 2026
Merged via the queue into PEtab-dev:main with commit 7149d19 Nov 17, 2026
8 checks passed
@dweindl
dweindl deleted the v2_lint_unused_placeholders branch November 17, 2026 13:59
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.

v2 linter: warn about declared placeholders that do not occur in any formula

3 participants