Skip to content

Fix incorrect initialization for non-constant initial assignments #2939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Aug 18, 2025

Fixes a bug where targets of initial assignments are not initialized correctly if the initial assignment expression is implicitly time-dependent. Fixes #2936.

  • eliminate state variables from x0 after replacing rate-of expressions
  • implement supposed-to-be static expressions that have non-constant entities in their initial condition as state variables instead of expressions.

Fixes a bug where targets of initial assignments are not initialized correctly if the initial assignment expression is implicitly time-dependent.
Fixes AMICI-dev#2936.
@dweindl dweindl self-assigned this Aug 18, 2025
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.02%. Comparing base (678f7a3) to head (0868fa6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
python/sdist/amici/sbml_import.py 92.30% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2939      +/-   ##
==========================================
- Coverage   79.57%   79.02%   -0.56%     
==========================================
  Files         362      362              
  Lines       23157    23174      +17     
  Branches     1588     1588              
==========================================
- Hits        18428    18313     -115     
- Misses       4717     4849     +132     
  Partials       12       12              
Flag Coverage Δ
cpp 74.96% <95.65%> (+0.01%) ⬆️
cpp_python 33.15% <69.56%> (+0.02%) ⬆️
petab 38.81% <60.86%> (+0.02%) ⬆️
python 73.81% <95.65%> (+0.01%) ⬆️
sbmlsuite-jax ?

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

Files with missing lines Coverage Δ
python/sdist/amici/de_model.py 92.50% <100.00%> (-0.37%) ⬇️
python/sdist/amici/sbml_import.py 80.16% <92.30%> (-11.88%) ⬇️

... and 4 files 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 marked this pull request as ready for review August 19, 2025 15:03
@dweindl dweindl requested a review from a team as a code owner August 19, 2025 15:03
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.

Constant parameter with initial assignment is compiled as a dynamic expression
1 participant