Skip to content

PEtab v1: Fix numeric noise overrides replacing the noise formula - #3585

Open
dweindl wants to merge 1 commit into
AMICI-dev:mainfrom
dweindl:petab_v1_numeric_noise_overrides
Open

dweindl wants to merge 1 commit into
AMICI-dev:mainfrom
dweindl:petab_v1_numeric_noise_overrides

Conversation

@dweindl

@dweindl dweindl commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Fixes numeric noiseParameters overrides replacing the whole noise formula in the PEtab v1 SUNDIALS simulation path, analogous to #3584 for PEtab v2. Since #921, _get_measurements_and_sigmas wrote any numeric noise parameter into the ExpData noise scales, regardless of the noise formula. Now this is done only for observables whose noise formula is just noiseParameter1_<observableId>; otherwise, the numeric override is applied via the parameter mapping, which already handled it.

To get test coverage from PEtab-dev/petab_test_suite#122 (new v1 case 0021, extended case 0006), the v1 test suite job now uses the current PEtab test suite instead of the pinned pre-v2 commit:

  • The v1 SBML and v2 tests share a single petab-test-suite dependency group (main).
  • test_petab_suite.py now only runs the PEtab v1 SBML cases by default; the v2 cases are run by test_petab_v2_suite.py.
  • The current test suite has no PySB cases with PEtab v1 tables. To keep the PEtab v1 PySB import tested until its removal (Deprecate PySB-based PEtab v1 import #3541), a separate workflow step reinstalls the pinned pre-v2 test suite (new petab-test-suite-v1-pysb group) and runs its PySB cases via the new --legacy-pysb option. These cases predate the new noise override tests, but the fixed code is the same for SBML and PySB models.
  • For case 0006, the simulation table is unflattened instead of comparing against hard-coded flattened observable IDs, which changed with the new noise parameter overrides.
  • Removed the JAX xfail for case 0021, which referred to the former pseudo-v2 case 0021.
  • For JAX, the experimentId column is dropped from the simulation table, since the current petabtests.evaluate_simulations rejects tables with both experimentId and simulationConditionId.

Fixes #3560 (together with #3584).

🤖 Generated with Claude Code

@dweindl dweindl added the PEtab PEtab-import related label Nov 16, 2026
@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.72%. Comparing base (7cb3c09) to head (0c1cae7).

Files with missing lines Patch % Lines
...n/sdist/amici/sim/sundials/petab/v1/_conditions.py 88.88% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3585      +/-   ##
==========================================
- Coverage   80.75%   80.72%   -0.04%     
==========================================
  Files         331      331              
  Lines       23699    23706       +7     
  Branches     1674     1674              
==========================================
- Hits        19139    19137       -2     
- Misses       4554     4563       +9     
  Partials        6        6              
Flag Coverage Δ
cpp 75.28% <88.88%> (-0.05%) ⬇️
cpp_python 34.87% <88.88%> (+0.01%) ⬆️
petab 47.19% <88.88%> (+0.01%) ⬆️
petab_sciml 16.50% <11.11%> (-0.01%) ⬇️
petab_sciml_benchmarks 15.11% <11.11%> (-0.01%) ⬇️
python 72.97% <88.88%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...n/sdist/amici/sim/sundials/petab/v1/_conditions.py 97.69% <88.88%> (-0.69%) ⬇️

... and 1 file with indirect coverage changes

🚀 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 16, 2026
Numeric `noiseParameters` were written directly to the `ExpData` noise
scales, regardless of the noise formula. Now this is only done for
observables whose noise formula is just `noiseParameter1_<observableId>`;
otherwise, the override is applied via the parameter mapping.

To cover this in CI, run the v1 test suite job against the current PEtab
test suite (`main`) instead of the pinned pre-v2 commit:
* Merge the v1/v2 `petab-test-suite` dependency groups.
* Only run PEtab v1 SBML cases in `test_petab_suite.py` by default.
* Keep testing PEtab v1 PySB import on the pinned pre-v2 test suite in a
  separate workflow step (`--legacy-pysb`,
  `petab-test-suite-v1-pysb`), until its removal (AMICI-dev#3541).
* Unflatten the simulation table for case 0006 instead of comparing
  against hard-coded flattened observable IDs.
* Drop the stale JAX xfail for the former case 0021.
* Drop `experimentId` from JAX simulation tables, which the current
  `petabtests.evaluate_simulations` rejects alongside
  `simulationConditionId`.

Relates to AMICI-dev#3560.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl
dweindl force-pushed the petab_v1_numeric_noise_overrides branch from 01bd780 to 0c1cae7 Compare November 17, 2026 07:01
@dweindl
dweindl marked this pull request as ready for review November 17, 2026 08:18
@dweindl
dweindl requested a review from a team as a code owner November 17, 2026 08:18

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PEtab PEtab-import related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PEtab: numeric noiseParameters overrides replace the whole noise formula

1 participant