Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* multiprocessing callables are module-scope and pickle-friendly * replace direct Process instantiation with get_mp_process utility
# Conflicts: # .github/workflows/ci.yml
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #671 +/- ##
==========================================
- Coverage 79.23% 79.21% -0.03%
==========================================
Files 141 141
Lines 8327 8337 +10
Branches 1110 1111 +1
==========================================
+ Hits 6598 6604 +6
- Misses 1359 1362 +3
- Partials 370 371 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Prepares the next pyABC release by updating supported Python/dependency versions, refreshing CI/tox and external-simulator test coverage, and adapting AMICI/PEtab integration to newer upstream APIs.
Changes:
- Update packaging/CI/tooling for newer Python (incl. 3.14) and dependency versions, and reorganize tox environments.
- Adapt AMICI/PEtab imports and solver API usage to AMICI ≥ 1.0.0 across library code, tests, and docs.
- Refactor parts of multiprocessing-based samplers and add new external R/rpy2 storage tests; various doc/example cleanups.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Adjust tox env extras/commands; add PEtab git deps; expand external-R tests; update quality tooling version. |
| test/petab/test_petab.py | Update AMICI PEtab importer calls to new API (import_petab_problem, create_solver, renamed kwargs). |
| test/petab/test_petab_suite.py | Update AMICI imports/API usage and simulation dataframe conversion function path. |
| test/external/test_rpy2_storage.py | Add rpy2-backed History storage roundtrip tests for R objects in sumstats. |
| test/external/test_rpy2_bytesstorage.py | Add rpy2-backed bytes storage roundtrip tests for R dataframes. |
| test/base/test_storage.py | Remove rpy2-based sumstat storage checks from base test suite. |
| test/base/test_integrated_model.py | Fix typo in comment. |
| test/base/test_bytesstorage.py | Remove rpy2-based bytes-storage cases from base tests. |
| pyproject.toml | Update Python requirement and bump multiple dependency minimum versions; adjust ruff target version. |
| pyabc/version.py | Bump library version constant. |
| pyabc/sampler/util.py | Add helper to select multiprocessing Process constructor (preferring fork). |
| pyabc/sampler/redis_eps/server_starter.py | Switch worker process creation to use new multiprocessing helper. |
| pyabc/sampler/redis_eps/cli.py | Switch worker process creation to use new multiprocessing helper. |
| pyabc/sampler/multicore.py | Switch process creation to use new multiprocessing helper. |
| pyabc/sampler/multicore_evaluation_parallel.py | Switch process creation to use new multiprocessing helper. |
| pyabc/petab/amici.py | Update AMICI/PEtab integration code to AMICI ≥ 1.0.0 API; adjust solver settings I/O. |
| pyabc/inference_util/inference_util.py | Refactor nested closures into top-level helpers and use functools.partial. |
| pyabc/epsilon/temperature.py | Minor docstring formatting cleanup. |
| doc/sampler.rst | Whitespace cleanup in docs. |
| doc/examples/wasserstein.ipynb | Normalize quoting style and small string literal updates. |
| doc/examples/using_R.ipynb | Normalize quoting style and small string literal updates. |
| doc/examples/sde_ion_channels.ipynb | Normalize quoting style and small string literal updates. |
| doc/examples/resuming.ipynb | Normalize quoting style and adjust a couple of cells to print instead of bare expressions. |
| doc/examples/petab_yaml2sbml.ipynb | Update AMICI API usage (import_petab_problem, create_solver, simulate, etc.). |
| doc/examples/petab_application.ipynb | Update AMICI API usage (import_petab_problem, create_solver) and minor formatting. |
| doc/examples/parameter_inference.ipynb | Normalize quoting style and minor string literal updates. |
| doc/examples/multiscale_agent_based.ipynb | Normalize quoting style and minor string literal updates. |
| doc/examples/model_selection.ipynb | Normalize quoting style and change a couple of cells from expression display to print/assert. |
| CHANGELOG.rst | Add new release-note section. |
| .pre-commit-config.yaml | Update default pre-commit Python version. |
| .github/workflows/install_deps.sh | Remove R install helper; trim AMICI apt deps. |
| .github/workflows/deploy.yml | Bump GitHub Actions versions used in deploy workflow. |
| .github/workflows/ci.yml | Update Python matrix (incl. 3.14), action versions, Julia setup, add setup-r, tweak dependency install logic, and make codecov upload non-blocking. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
pyabc/sampler/util.py:21
get_mp_process()can return aProcessclass from a different multiprocessing context (fork) than the one used to createQueue/Valueobjects elsewhere (which use the default context). Mixing contexts is known to raise runtime errors (e.g. SemLock/context mismatch) on platforms where the default start method isspawn(macOS) or when users set a non-fork start method.
To avoid cross-context issues, return the Process class from the current/default context (or alternatively expose a get_mp_context() helper and create Queue/Value from that same context).
def get_mp_process():
"""Get a multiprocessing Process constructor.
On POSIX, prefer ``fork`` when available to support non-picklable
callables (e.g. local functions in tests) in nested worker setups.
"""
if 'fork' in mp.get_all_start_methods():
return mp.get_context('fork').Process
return mp.Process
General:
time, and within it the population size calculation and distance function ´
adaptation. The timings are also returned by
run_generation. Resolves Profiling #325.Visualization:
plot_walltimeandplot_total_walltimenow report the actualper-generation walltimes and no longer include the idle time that passed
between a stored analysis and a later resumed run. Resolves Walltime plots do not show actual walltime if stored abc runs are resumed #667.
Storage:
wall_timecolumn,database version 2). Databases created with older pyABC versions must be
migrated via
abc-migratebefore they can be resumed; for such databasesthe walltime plots fall back to the previous, end-time-based behavior.
to 1 across all particles of all models, matching the in-memory
Populationrepresentation). This is bundled into database version 2 andhandled by
abc-migratefor existing databases. Resolves Normalization of weights #47.