Repository navigation
PEtab v2: Fix numeric noise overrides replacing the noise formula - #3584
Merged
Merged
Conversation
A single numeric `noiseParameters` value was written into the `ExpData` noise scales, replacing the model-computed sigma, regardless of the noise formula. For any noise formula other than the bare noise placeholder, sigma and the likelihood were wrong. Use numeric overrides as sigmas directly only if the noise formula is just the noise placeholder (for PySB, resolving the `<obs>_sigma` expression). Otherwise, the override is applied to the placeholder parameter. Accordingly, timepoint-specific numeric noise overrides are only accepted without flattening for such noise formulas. Fixes AMICI-dev#3560. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3584 +/- ##
=======================================
Coverage 80.71% 80.72%
=======================================
Files 331 331
Lines 23688 23699 +11
Branches 1674 1674
=======================================
+ Hits 19120 19131 +11
Misses 4562 4562
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
dilpath
approved these changes
Nov 16, 2026
| # experiment | ||
| # experiment, and the noise formula is just that placeholder | ||
| # (the literals are then passed as sigmas via ExpData) | ||
| id_to_observable = {o.id: o for o in self.petab_problem.observables} |
Member
There was a problem hiding this comment.
self.petab_problem has __getitem__ for this I think?
Member
Author
There was a problem hiding this comment.
That's correct, but for larger problems, this is very expensive because for every lookup, it iterates over many lists of various entities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes numeric
noiseParametersoverrides in the PEtab v2 SUNDIALS simulator replacing the whole noise formula instead of being substituted into it. For any noise formula other than the bare noise placeholder, sigma and the likelihood were wrong, without a warning.ExperimentManagerpasses a numeric override directly as sigma viaExpDataonly if the noise formula is exactly the noise placeholder (for PySB models, after resolving the<obs>_sigmaexpression created during import). Otherwise, the override is applied to the placeholder parameter as for non-numeric overrides.PetabImporteraccepts timepoint-specific numeric noise overrides without flattening only for such bare-placeholder noise formulas. The error message now suggestsflatten_timepoint_specific_output_overrides.Test coverage is added in the PEtab test suite (PEtab-dev/petab_test_suite#122, cases 0006 and 0033), which the v2 suite job uses from
main. Those cases fail without this fix.The PEtab v1 path has the same problem; that will be addressed separately.
Relates to #3560 (PEtab v2 part).
🤖 Generated with Claude Code