Skip to content

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Nov 14, 2025

Pull rateOf-handling out of DEModel and keep it along other SBML processing where it belongs.

This is easier to follow and prevents some lingering issues with the old approach due to the xdot / w interdependencies.

This also handles rateOf expressions in some additional, previously unsupported places like event assignments.

I think this also fixes a potential bug in the w reordering in _process_hybridization that might otherwise trigger in combination with conservations laws, because they might end up at the beginning of w.

A minor downside is that in xdot rateOf expressions are replaced by the respective xdot equations where previously xdot symbols were used, but I prefer the reduced complexity. If this becomes a performance problem, this can easily be addressed by shifting rateOf into w by adding an extra assignment rule to the model.

@dweindl dweindl self-assigned this Nov 14, 2025
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 92.06349% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.38%. Comparing base (7bf3b76) to head (e7b4896).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
python/sdist/amici/importers/sbml/__init__.py 89.36% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3036      +/-   ##
==========================================
- Coverage   77.41%   77.38%   -0.03%     
==========================================
  Files         311      311              
  Lines       20594    20597       +3     
  Branches     1500     1499       -1     
==========================================
- Hits        15942    15940       -2     
- Misses       4642     4647       +5     
  Partials       10       10              
Flag Coverage Δ
cpp 70.31% <92.06%> (-0.03%) ⬇️
cpp_python 36.81% <60.31%> (+0.06%) ⬆️
petab 45.80% <61.90%> (+0.07%) ⬆️
petab_sciml 13.73% <58.73%> (+0.06%) ⬆️
python 69.32% <92.06%> (-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/de_model.py 91.64% <100.00%> (-0.49%) ⬇️
python/sdist/amici/importers/pysb/__init__.py 94.54% <ø> (ø)
python/sdist/amici/importers/sbml/__init__.py 82.52% <89.36%> (+0.31%) ⬆️

... 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 force-pushed the refactor_rateof branch 3 times, most recently from 5a5a64f to 0eea980 Compare November 15, 2025 08:25
GitHub Action runners run out of disk space when installing petab-sciml with all its huge dependencies.
Don't install that for now. So far, it's not used anywhere for the documentation build as far as I can see.
This won't prevent enabling intersphinx later on.
@dweindl dweindl marked this pull request as ready for review November 15, 2025 09:10
@dweindl dweindl requested a review from a team as a code owner November 15, 2025 09:10
if rate_ofs := ae.get_val().find(rate_of_func):
# Not implemented
raise SBMLException(
"rateOf() is not supported in algebraic equations."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include name of ae?, why is this necessary in given is_ode check below?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include name of ae?

👍

why is this necessary in given is_ode check below?

Currently, no substitution is even attempted for any ae. Therefore, that check will never trigger. Will add a comment.

Pull rateOf-handling out of DEModel and keep it along other SBML processing where it belongs.

This is easier to follow and prevents some lingering issues with the old approach due to the xdot / w interdependencies.

This also handles rateOf expressions in some additional, previously unsupported places like event assignments.
@dweindl dweindl added this pull request to the merge queue Nov 15, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 15, 2025
* doc: Skip petab-sciml for now

GitHub Action runners run out of disk space when installing petab-sciml with all its huge dependencies.
Don't install that for now. So far, it's not used anywhere for the documentation build as far as I can see.
This won't prevent enabling intersphinx later on.

* Refactor rateOf handling

Pull rateOf-handling out of DEModel and keep it along other SBML processing where it belongs.

This is easier to follow and prevents some lingering issues with the old approach due to the xdot / w interdependencies.

This also handles rateOf expressions in some additional, previously unsupported places like event assignments.
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2025
@dweindl dweindl added this pull request to the merge queue Nov 15, 2025
Merged via the queue into AMICI-dev:main with commit d8c41f3 Nov 15, 2025
32 of 33 checks passed
@dweindl dweindl deleted the refactor_rateof branch November 15, 2025 15:02
dweindl added a commit to dweindl/AMICI that referenced this pull request Nov 15, 2025
* doc: Skip petab-sciml for now

GitHub Action runners run out of disk space when installing petab-sciml with all its huge dependencies.
Don't install that for now. So far, it's not used anywhere for the documentation build as far as I can see.
This won't prevent enabling intersphinx later on.

* Refactor rateOf handling

Pull rateOf-handling out of DEModel and keep it along other SBML processing where it belongs.

This is easier to follow and prevents some lingering issues with the old approach due to the xdot / w interdependencies.

This also handles rateOf expressions in some additional, previously unsupported places like event assignments.
dweindl added a commit to dweindl/AMICI that referenced this pull request Nov 17, 2025
With AMICI-dev#3036, the ordering of symbols and expressions has changed.
This is not a problem per se, but would require recreating the
test oracles for the models in `models/`.
Therefore, don't do any unnecessary reordering.
@dweindl dweindl mentioned this pull request Nov 17, 2025
dweindl added a commit to dweindl/AMICI that referenced this pull request Nov 17, 2025
With AMICI-dev#3036, the ordering of symbols and expressions has changed.
This is not a problem per se, but would require recreating the
test oracles for the models in `models/`.
Therefore, don't do any unnecessary reordering.
dweindl added a commit to dweindl/AMICI that referenced this pull request Nov 18, 2025
With AMICI-dev#3036, the ordering of `w` symbols and expressions has changed.
This is not a problem per se, but would require recreating the
test oracles for the models in `models/`.
Therefore, don't do any unnecessary reordering.
github-merge-queue bot pushed a commit that referenced this pull request Nov 18, 2025
With #3036, the ordering of `w` symbols and expressions has changed.
This is not a problem per se, but would require recreating the
test oracles for the models in `models/`.
Therefore, don't do any unnecessary reordering.
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