Skip to content

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Oct 22, 2025

Enable pickling of ModelPtr for use in multiprocessing contexts.

Related to #1126.

@dweindl dweindl self-assigned this Oct 22, 2025
@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.83%. Comparing base (785ab4b) to head (624b4b3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2985      +/-   ##
==========================================
- Coverage   76.48%   75.83%   -0.66%     
==========================================
  Files         308      308              
  Lines       20136    20149      +13     
  Branches     1499     1500       +1     
==========================================
- Hits        15402    15280     -122     
- Misses       4721     4856     +135     
  Partials       13       13              
Flag Coverage Δ
cpp 73.02% <100.00%> (+0.01%) ⬆️
cpp_python 38.30% <15.38%> (-0.02%) ⬇️
petab 38.91% <15.38%> (-0.02%) ⬇️
python 69.65% <100.00%> (+0.02%) ⬆️
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/swig_wrappers.py 98.93% <100.00%> (+0.17%) ⬆️

... and 6 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 October 22, 2025 20:08
@dweindl dweindl requested a review from a team as a code owner October 22, 2025 20:08
Enable pickling of `ModelPtr` for use in multiprocessing contexts.
model_module = sbml_example_presimulation_module
model = model_module.get_model()

assert (
Copy link
Member

Choose a reason for hiding this comment

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

we are already testing other settings programmatically in corresponding tests for get_model_settings, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct.

@dweindl dweindl merged commit b8307a1 into AMICI-dev:main Oct 23, 2025
17 of 18 checks passed
@dweindl dweindl deleted the pickle_modelptr branch October 23, 2025 10:16
dweindl added a commit to dweindl/AMICI that referenced this pull request Oct 27, 2025
Ensure `Model.module` gets set during `Model.clone()`.
So far, this was only set during `model_module.get_model`.
Fixes unpickling of cloned Models.

Also implement `ModelPtr.__reduce__` in addition to `Model.__reduce__` (AMICI-dev#2985).
dweindl added a commit to dweindl/AMICI that referenced this pull request Oct 27, 2025
Ensure `Model.module` gets set during `Model.clone()`.
So far, this was only set during `model_module.get_model`.
Fixes unpickling of cloned Models.

Also implement `ModelPtr.__reduce__` in addition to `Model.__reduce__` (AMICI-dev#2985).
dweindl added a commit to dweindl/AMICI that referenced this pull request Oct 29, 2025
Ensure `Model.module` gets set during `Model.clone()`.
So far, this was only set during `model_module.get_model`.
Fixes unpickling of cloned Models.

Also implement `ModelPtr.__reduce__` in addition to `Model.__reduce__` (AMICI-dev#2985).
dweindl added a commit that referenced this pull request Oct 29, 2025
Ensure `Model.module` gets set during `Model.clone()`.
So far, this was only set during `model_module.get_model`.
Fixes unpickling of cloned Models.

Also implement `ModelPtr.__reduce__` in addition to `Model.__reduce__` (#2985).
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