Skip to content

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Oct 13, 2025

Experimental import of SBML- and PySB-based PEtab v2 problems.
Not particularly performant or feature-complete yet - to be extended.

Closes #2662.

👀 https://amici--2974.org.readthedocs.build/en/2974/examples/example_petab/petab_v2.html
👀 https://amici--2974.org.readthedocs.build/en/2974/generated/amici.petab.petab_importer.html#module-amici.petab.petab_importer

@dweindl dweindl self-assigned this Oct 13, 2025
@dweindl dweindl force-pushed the petab_v2_import branch 2 times, most recently from 074fdb9 to 1904851 Compare October 13, 2025 11:57
@codecov
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

❌ Patch coverage is 91.32290% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.38%. Comparing base (7f15329) to head (c0aab52).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
python/sdist/amici/petab/petab_importer.py 89.69% 60 Missing ⚠️
python/sdist/amici/adapters/fiddy.py 95.45% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2974      +/-   ##
==========================================
+ Coverage   76.71%   77.38%   +0.67%     
==========================================
  Files         309      311       +2     
  Lines       19899    20597     +698     
  Branches     1497     1500       +3     
==========================================
+ Hits        15265    15939     +674     
- Misses       4621     4648      +27     
+ Partials       13       10       -3     
Flag Coverage Δ
cpp 70.32% <2.28%> (-2.17%) ⬇️
cpp_python 36.77% <0.65%> (-1.13%) ⬇️
petab 45.69% <86.20%> (+7.16%) ⬆️
petab_sciml 13.64% <0.00%> (-0.51%) ⬇️
python 69.33% <69.44%> (+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/gradient_check.py 95.68% <100.00%> (ø)
python/sdist/amici/pysb_import.py 94.54% <100.00%> (+0.05%) ⬆️
python/tests/petab_/test_petab_v2.py 100.00% <100.00%> (ø)
src/amici.cpp 71.57% <ø> (-5.27%) ⬇️
python/sdist/amici/adapters/fiddy.py 78.67% <95.45%> (+1.48%) ⬆️
python/sdist/amici/petab/petab_importer.py 89.69% <89.69%> (ø)

... and 14 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 force-pushed the petab_v2_import branch 10 times, most recently from 5ce3337 to 3b9080f Compare October 17, 2025 20:38
@dweindl dweindl force-pushed the petab_v2_import branch 2 times, most recently from cfeb505 to 02ad833 Compare October 27, 2025 20:51
@dweindl dweindl force-pushed the petab_v2_import branch 14 times, most recently from 31db7ab to a90f960 Compare November 2, 2025 15:00
@dweindl dweindl requested a review from a team as a code owner November 4, 2025 14:49
# compile amici model
if case.startswith("0006") and not jax:
# TODO: petab.flatten_timepoint_specific_output_overrides(problem)
# petab.flatten_timepoint_specific_output_overrides(problem)
Copy link
Member

Choose a reason for hiding this comment

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

Other tests suggest this is now supported

Copy link
Member Author

Choose a reason for hiding this comment

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

Now implemented.

# TODO: So far, PEtab can only upgrade file-based problems,
# not petab.v1.Problem objects.
raise NotImplementedError(
"Only `petab.v2.Problem` is currently supported. "
Copy link
Member

Choose a reason for hiding this comment

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

should this error message explicitly mention incompatibility with file based problems to avoid confusion?

Copy link
Member Author

Choose a reason for hiding this comment

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

Reworded.

):
target_entity.value = expr
else:
# if the target is not an expression, it must be an
Copy link
Member

Choose a reason for hiding this comment

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

TODO: would be more efficient to convert this into a multi-model problem, but who knows whether we will ever get around to implementing that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added as TODO.

@dweindl dweindl merged commit 107f90f into AMICI-dev:main Nov 10, 2025
20 checks passed
@dweindl dweindl deleted the petab_v2_import branch November 10, 2025 09:51
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.

Implement PEtab v2 import

2 participants