Skip to content

Resolve original condition ids in reinit - #3230

Open
BSnelling wants to merge 4 commits into
mainfrom
bes/cond_state_resolution
Open

Resolve original condition ids in reinit#3230
BSnelling wants to merge 4 commits into
mainfrom
bes/cond_state_resolution

Conversation

@BSnelling

@BSnelling BSnelling commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Updating the function _condition_reinit_target_value to resolve conditions ids in the same way as _eval_nn does, while preserving gradient tracing.

The context in which I noticed this bug was a JAXProblem built from a PetabImporter instance. The underlying petab problem contained conditions which modified a model state variable. The PetabImporter changes the names of conditions and condition targets as part of import which is why _eval_nn needs to resolve current condition ids to originals, and why _condition_reinit_target_value should do the same.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.60%. Comparing base (ac032df) to head (5aed7ce).

Files with missing lines Patch % Lines
python/sdist/amici/sim/jax/petab.py 96.87% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3230   +/-   ##
=======================================
  Coverage   78.59%   78.60%           
=======================================
  Files         318      318           
  Lines       21106    21122   +16     
  Branches     1487     1487           
=======================================
+ Hits        16589    16602   +13     
- Misses       4509     4512    +3     
  Partials        8        8           
Flag Coverage Δ
cpp 72.03% <75.00%> (+0.03%) ⬆️
cpp_python 36.53% <0.00%> (-0.03%) ⬇️
petab 48.36% <78.12%> (+0.06%) ⬆️
petab_sciml 16.32% <68.75%> (+0.04%) ⬆️
petab_sciml_benchmarks 14.89% <43.75%> (+0.03%) ⬆️
python 70.41% <75.00%> (+0.04%) ⬆️
sbmlsuite-jax 31.59% <12.50%> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
python/sdist/amici/sim/jax/petab.py 91.94% <96.87%> (+0.43%) ⬆️

... and 3 files with indirect coverage changes

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

@BSnelling
BSnelling force-pushed the bes/cond_state_resolution branch from 45e3dde to 5aed7ce Compare August 12, 2026 10:11
@BSnelling
BSnelling marked this pull request as ready for review August 12, 2026 10:50
@BSnelling
BSnelling requested a review from a team as a code owner August 12, 2026 10:50
@FFroehlich
FFroehlich requested a review from dweindl August 12, 2026 15:20
@FFroehlich

Copy link
Copy Markdown
Member

@dweindl does this look good to you?

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.

2 participants