mxlpy-native 0.4.0__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/MANIFEST.in +1 -0
- {mxlpy_native-0.4.0/src/mxlpy_native.egg-info → mxlpy_native-0.6.0}/PKG-INFO +6 -4
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/README.md +5 -3
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/mxn_solvers.c +109 -1
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/VENDORED +22 -1
- mxlpy_native-0.6.0/c/vendor/adjoint_wrapper.c +897 -0
- mxlpy_native-0.6.0/c/vendor/dop853.c +1271 -0
- mxlpy_native-0.6.0/c/vendor/dopri5.c +1139 -0
- mxlpy_native-0.6.0/c/vendor/fit_experiments.c +386 -0
- mxlpy_native-0.6.0/c/vendor/fit_experiments.h +165 -0
- mxlpy_native-0.6.0/c/vendor/jacobian_wrapper.c +563 -0
- mxlpy_native-0.6.0/c/vendor/minpack/COPYRIGHT.txt +52 -0
- mxlpy_native-0.6.0/c/vendor/minpack/cminpack.h +393 -0
- mxlpy_native-0.6.0/c/vendor/minpack/cminpackP.h +70 -0
- mxlpy_native-0.6.0/c/vendor/minpack/dpmpar.c +192 -0
- mxlpy_native-0.6.0/c/vendor/minpack/enorm.c +204 -0
- mxlpy_native-0.6.0/c/vendor/minpack/fdjac2.c +123 -0
- mxlpy_native-0.6.0/c/vendor/minpack/lmder.c +358 -0
- mxlpy_native-0.6.0/c/vendor/minpack/lmdif.c +531 -0
- mxlpy_native-0.6.0/c/vendor/minpack/lmpar.c +357 -0
- mxlpy_native-0.6.0/c/vendor/minpack/minpackP.h +66 -0
- mxlpy_native-0.6.0/c/vendor/minpack/qrfac.c +320 -0
- mxlpy_native-0.6.0/c/vendor/minpack/qrsolv.c +222 -0
- mxlpy_native-0.6.0/c/vendor/radau5_wrapper.c +419 -0
- mxlpy_native-0.6.0/c/vendor/solver_common.c +123 -0
- mxlpy_native-0.6.0/c/vendor/solver_common.h +39 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/pyproject.toml +1 -1
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/setup.py +18 -1
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/src/mxlpy_native/__init__.py +1 -1
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0/src/mxlpy_native.egg-info}/PKG-INFO +6 -4
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/src/mxlpy_native.egg-info/SOURCES.txt +23 -0
- mxlpy_native-0.6.0/tests/test_adjoint.py +96 -0
- mxlpy_native-0.6.0/tests/test_fit.py +107 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/LICENSE +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/HAIRER-LICENCE.txt +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/SCIPY-LICENCE.txt +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/SUNDIALS-LICENCE.txt +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/SUNDIALS-NOTICE.txt +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/blaslapack_declarations.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/dc_decsol.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/decsol.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/f2c.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/libf2c_stubs.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/lsoda.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/lsoda.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/mxs_lapack.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/radau5.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/cvode/cvode.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/cvode/cvode_diag.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/cvode/cvode_ls.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/cvode/cvode_proj.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/nvector/nvector_serial.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/priv/sundials_context_impl.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/priv/sundials_errors_impl.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/priv/sundials_logger_macros.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_adaptcontroller.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_adjointcheckpointscheme.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_adjointstepper.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_band.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_config.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_context.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_core.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_dense.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_direct.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_domeigestimator.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_errors.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_export.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_futils.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_iterative.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_linearsolver.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_logger.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_math.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_matrix.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_memory.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_nonlinearsolver.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_nvector.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_nvector_senswrapper.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_profiler.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_stepper.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_types.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sundials/sundials_version.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sunlinsol/sunlinsol_dense.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sunmatrix/sunmatrix_band.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sunmatrix/sunmatrix_dense.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sunmatrix/sunmatrix_sparse.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sunnonlinsol/sunnonlinsol_fixedpoint.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/include/sunnonlinsol/sunnonlinsol_newton.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode_diag_impl.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode_fused_stubs.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode_impl.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode_io.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode_ls.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode_ls_impl.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode_nls.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode_proj.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/cvode/cvode_proj_impl.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/nvector/serial/nvector_serial.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/stl/sunstl_vector.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_adiak_metadata.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_band.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_context.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_debug.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_dense.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_errors.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_futils.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_hashmap_impl.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_linearsolver.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_logger.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_logger_impl.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_macros.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_math.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_matrix.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_memory.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_nonlinearsolver.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_nvector.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_nvector_senswrapper.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_utils.h +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sundials/sundials_version.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sunlinsol/dense/sunlinsol_dense.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sunmatrix/band/sunmatrix_band.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sunmatrix/dense/sunmatrix_dense.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/c/vendor/sundials/src/sunnonlinsol/newton/sunnonlinsol_newton.c +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/setup.cfg +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/src/mxlpy_native/__main__.py +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/src/mxlpy_native.egg-info/dependency_links.txt +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/src/mxlpy_native.egg-info/requires.txt +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/src/mxlpy_native.egg-info/top_level.txt +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/tests/test_build_errors.py +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/tests/test_solvers.py +0 -0
- {mxlpy_native-0.4.0 → mxlpy_native-0.6.0}/tests/test_vendor.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mxlpy-native
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Compiled ODE solvers (RADAU5, LSODA, SUNDIALS CVODE) for MxlPy's Native integrator
|
|
5
5
|
Author-email: Marvin van Aalst <marvin.vanaalst@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -24,7 +24,7 @@ Dynamic: license-file
|
|
|
24
24
|
|
|
25
25
|
# mxlpy-native
|
|
26
26
|
|
|
27
|
-
The compiled Radau, LSODA and CVODE solvers behind [MxlPy](https://github.com/Computational-Biology-Aachen/MxlPy)'s `Native` integrator, plus `llvmlite`, which compiles models to machine code for them. Install it through MxlPy rather than on its own:
|
|
27
|
+
The compiled Radau, LSODA and CVODE solvers and the Levenberg-Marquardt fit loop behind [MxlPy](https://github.com/Computational-Biology-Aachen/MxlPy)'s `Native` integrator, plus `llvmlite`, which compiles models to machine code for them. Install it through MxlPy rather than on its own:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
pip install "mxlpy[native]"
|
|
@@ -36,9 +36,11 @@ pip install "mxlpy[native]"
|
|
|
36
36
|
|---|---|---|
|
|
37
37
|
| RADAU5 | E. Hairer and G. Wanner, via f2c | `c/vendor/HAIRER-LICENCE.txt` |
|
|
38
38
|
| LSODA | SciPy's C translation of ODEPACK | `c/vendor/SCIPY-LICENCE.txt` |
|
|
39
|
+
| DOP853, DOPRI5 (used by the fit loop's solver layer) | E. Hairer and G. Wanner, via f2c | `c/vendor/HAIRER-LICENCE.txt` |
|
|
40
|
+
| Fit loop: `lmder` with forward sensitivities over time courses and steady states | mxl-solvers' fit drivers and [cminpack](https://github.com/devernay/cminpack) | `LICENSE`, `c/vendor/minpack/COPYRIGHT.txt` |
|
|
39
41
|
| CVODE (BDF and Adams) | [SUNDIALS](https://github.com/LLNL/sundials) v7.9.0, © Lawrence Livermore National Security and the SUNDIALS contributors | `c/vendor/SUNDIALS-LICENCE.txt` (BSD-3-Clause), `c/vendor/SUNDIALS-NOTICE.txt` |
|
|
40
42
|
|
|
41
|
-
All
|
|
43
|
+
All of them are vendored from [mxl-solvers](https://github.com/Computational-Biology-Aachen/mxl-solvers), whose README lists the papers to cite for SUNDIALS. The licence files ship in every wheel.
|
|
42
44
|
|
|
43
45
|
## Platforms
|
|
44
46
|
|
|
@@ -61,7 +63,7 @@ uv sync # builds the extension in place
|
|
|
61
63
|
uv run pytest
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
`c/vendor/` is copied from [mxl-solvers](https://github.com/Computational-Biology-Aachen/mxl-solvers) by its `scripts/vendor.sh`. `vendor/VENDORED` records the commit and file hashes, which `tests/test_vendor.py` checks. Fix solvers there, not here. `c/mxn_solvers.c` is the glue MxlPy calls, compiled unchanged into the wheel and into MxlPy's `solvers.wasm` (`scripts/build_native_wasm.sh` in MxlPy).
|
|
66
|
+
`c/vendor/` is copied from [mxl-solvers](https://github.com/Computational-Biology-Aachen/mxl-solvers) by its `scripts/vendor.sh`. `vendor/VENDORED` records the commit and file hashes, which `tests/test_vendor.py` checks. Fix solvers there, not here. `c/mxn_solvers.c` is the glue MxlPy calls (`mxn_radau` / `mxn_lsoda` / `mxn_cvode` for simulations, `mxn_fit_*` for least-squares fits, `mxn_adjoint_*` for adjoint gradients), compiled unchanged into the wheel and into MxlPy's `solvers.wasm` (`scripts/build_native_wasm.sh` in MxlPy).
|
|
65
67
|
|
|
66
68
|
When an exported function's signature or meaning changes, bump `MXN_ABI_VERSION` in `c/mxn_solvers.c`, `ABI_VERSION` in `src/mxlpy_native/__init__.py` and the ABI MxlPy expects, then release both. MxlPy refuses a mismatched pair with an upgrade hint instead of crashing.
|
|
67
69
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# mxlpy-native
|
|
2
2
|
|
|
3
|
-
The compiled Radau, LSODA and CVODE solvers behind [MxlPy](https://github.com/Computational-Biology-Aachen/MxlPy)'s `Native` integrator, plus `llvmlite`, which compiles models to machine code for them. Install it through MxlPy rather than on its own:
|
|
3
|
+
The compiled Radau, LSODA and CVODE solvers and the Levenberg-Marquardt fit loop behind [MxlPy](https://github.com/Computational-Biology-Aachen/MxlPy)'s `Native` integrator, plus `llvmlite`, which compiles models to machine code for them. Install it through MxlPy rather than on its own:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
pip install "mxlpy[native]"
|
|
@@ -12,9 +12,11 @@ pip install "mxlpy[native]"
|
|
|
12
12
|
|---|---|---|
|
|
13
13
|
| RADAU5 | E. Hairer and G. Wanner, via f2c | `c/vendor/HAIRER-LICENCE.txt` |
|
|
14
14
|
| LSODA | SciPy's C translation of ODEPACK | `c/vendor/SCIPY-LICENCE.txt` |
|
|
15
|
+
| DOP853, DOPRI5 (used by the fit loop's solver layer) | E. Hairer and G. Wanner, via f2c | `c/vendor/HAIRER-LICENCE.txt` |
|
|
16
|
+
| Fit loop: `lmder` with forward sensitivities over time courses and steady states | mxl-solvers' fit drivers and [cminpack](https://github.com/devernay/cminpack) | `LICENSE`, `c/vendor/minpack/COPYRIGHT.txt` |
|
|
15
17
|
| CVODE (BDF and Adams) | [SUNDIALS](https://github.com/LLNL/sundials) v7.9.0, © Lawrence Livermore National Security and the SUNDIALS contributors | `c/vendor/SUNDIALS-LICENCE.txt` (BSD-3-Clause), `c/vendor/SUNDIALS-NOTICE.txt` |
|
|
16
18
|
|
|
17
|
-
All
|
|
19
|
+
All of them are vendored from [mxl-solvers](https://github.com/Computational-Biology-Aachen/mxl-solvers), whose README lists the papers to cite for SUNDIALS. The licence files ship in every wheel.
|
|
18
20
|
|
|
19
21
|
## Platforms
|
|
20
22
|
|
|
@@ -37,7 +39,7 @@ uv sync # builds the extension in place
|
|
|
37
39
|
uv run pytest
|
|
38
40
|
```
|
|
39
41
|
|
|
40
|
-
`c/vendor/` is copied from [mxl-solvers](https://github.com/Computational-Biology-Aachen/mxl-solvers) by its `scripts/vendor.sh`. `vendor/VENDORED` records the commit and file hashes, which `tests/test_vendor.py` checks. Fix solvers there, not here. `c/mxn_solvers.c` is the glue MxlPy calls, compiled unchanged into the wheel and into MxlPy's `solvers.wasm` (`scripts/build_native_wasm.sh` in MxlPy).
|
|
42
|
+
`c/vendor/` is copied from [mxl-solvers](https://github.com/Computational-Biology-Aachen/mxl-solvers) by its `scripts/vendor.sh`. `vendor/VENDORED` records the commit and file hashes, which `tests/test_vendor.py` checks. Fix solvers there, not here. `c/mxn_solvers.c` is the glue MxlPy calls (`mxn_radau` / `mxn_lsoda` / `mxn_cvode` for simulations, `mxn_fit_*` for least-squares fits, `mxn_adjoint_*` for adjoint gradients), compiled unchanged into the wheel and into MxlPy's `solvers.wasm` (`scripts/build_native_wasm.sh` in MxlPy).
|
|
41
43
|
|
|
42
44
|
When an exported function's signature or meaning changes, bump `MXN_ABI_VERSION` in `c/mxn_solvers.c`, `ABI_VERSION` in `src/mxlpy_native/__init__.py` and the ABI MxlPy expects, then release both. MxlPy refuses a mismatched pair with an upgrade hint instead of crashing.
|
|
43
45
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
/* Bump whenever an exported signature or its meaning changes, together with ABI_VERSION
|
|
25
25
|
* in mxlpy_native/__init__.py and the version MxlPy's Native integrator expects. */
|
|
26
|
-
#define MXN_ABI_VERSION
|
|
26
|
+
#define MXN_ABI_VERSION 4
|
|
27
27
|
MXN_API int mxn_abi_version(void) { return MXN_ABI_VERSION; }
|
|
28
28
|
|
|
29
29
|
extern int radau5_(integer *n, U_fp fcn, doublereal *x, doublereal *y, doublereal *xend, doublereal *h,
|
|
@@ -236,6 +236,114 @@ MXN_API void mxn_eval_rows(intptr_t fn, int n, int n_out, int rows, const double
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
/* ------------------------------------------------------------------ */
|
|
240
|
+
/* Levenberg-Marquardt fits with forward sensitivities */
|
|
241
|
+
/* ------------------------------------------------------------------ */
|
|
242
|
+
/* Exported wrappers around mxl-solvers' jacobian_wrapper.c (lmder over an augmented system of
|
|
243
|
+
* states and sensitivities, see its header comment) and fit_experiments.h, which defines the
|
|
244
|
+
* experiment layout. Like the solvers above, a fit keeps global state, so only one runs at a
|
|
245
|
+
* time. Functions are function pointers natively and table indices in wasm. */
|
|
246
|
+
void set_derived_fn(intptr_t fn);
|
|
247
|
+
void set_derived_grad_fn(intptr_t fn);
|
|
248
|
+
void jacobian_set_plain_fn(intptr_t fn);
|
|
249
|
+
void jacobian_set_augmented_fn(intptr_t fn);
|
|
250
|
+
int jacobian_init(int n_y, double *y0, int n_pars, double *pars, int n_theta, int *theta_idx,
|
|
251
|
+
int *log_flags, int n_targets, int *target_kind, int *target_index, double *target_scale,
|
|
252
|
+
int n_ovr, int *ovr_idx, int n_exp, int *exp_kind, int *exp_n_seg, int *exp_n_points,
|
|
253
|
+
int n_seg_total, double *seg_t_end, double *seg_ovr, int n_points, double *data_t,
|
|
254
|
+
double *data_y, int n_derived, int solver_id, double rtol, double atol, double ss_tol,
|
|
255
|
+
double ss_t_max, double target_residual_norm, int progress_interval);
|
|
256
|
+
int jacobian_chunk(int maxfev);
|
|
257
|
+
int jacobian_get_nfev(void);
|
|
258
|
+
double jacobian_get_residual_norm(void);
|
|
259
|
+
void jacobian_get_params(double *out);
|
|
260
|
+
int jacobian_get_predictions(double *out);
|
|
261
|
+
int jacobian_get_jacobian(double *out);
|
|
262
|
+
void jacobian_free(void);
|
|
263
|
+
|
|
264
|
+
/* plain: the model (n_y outputs); augmented: states then sensitivities, parameter-major
|
|
265
|
+
* (n_y * (1 + n_theta) outputs); derived / derived_grad: derived targets and their gradients
|
|
266
|
+
* [d/dy, d/dtheta] per target, 0 if there are none. */
|
|
267
|
+
MXN_API void mxn_fit_set_fns(intptr_t plain, intptr_t augmented, intptr_t derived,
|
|
268
|
+
intptr_t derived_grad) {
|
|
269
|
+
jacobian_set_plain_fn(plain);
|
|
270
|
+
jacobian_set_augmented_fn(augmented);
|
|
271
|
+
set_derived_fn(derived);
|
|
272
|
+
set_derived_grad_fn(derived_grad);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* Arguments as jacobian_init (fit_experiments.h): returns 0, -1 out of memory, -2 a log
|
|
276
|
+
* parameter isn't positive, -3 inconsistent experiments, -4 a fitted parameter is overridden,
|
|
277
|
+
* -5 derived targets without derived functions. */
|
|
278
|
+
MXN_API int mxn_fit_init(int n_y, double *y0, int n_pars, double *pars, int n_theta, int *theta_idx,
|
|
279
|
+
int *log_flags, int n_targets, int *target_kind, int *target_index,
|
|
280
|
+
double *target_scale, int n_ovr, int *ovr_idx, int n_exp, int *exp_kind,
|
|
281
|
+
int *exp_n_seg, int *exp_n_points, int n_seg_total, double *seg_t_end,
|
|
282
|
+
double *seg_ovr, int n_points, double *data_t, double *data_y, int n_derived,
|
|
283
|
+
int solver_id, double rtol, double atol, double ss_tol, double ss_t_max) {
|
|
284
|
+
return jacobian_init(n_y, y0, n_pars, pars, n_theta, theta_idx, log_flags, n_targets, target_kind,
|
|
285
|
+
target_index, target_scale, n_ovr, ovr_idx, n_exp, exp_kind, exp_n_seg,
|
|
286
|
+
exp_n_points, n_seg_total, seg_t_end, seg_ovr, n_points, data_t, data_y,
|
|
287
|
+
n_derived, solver_id, rtol, atol, ss_tol, ss_t_max, -1.0, 0);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* Runs lmder for at most maxfev residual evaluations. Returns MINPACK's info: 1-4 converged,
|
|
291
|
+
* 5 out of evaluations (call again to continue), others failed. */
|
|
292
|
+
MXN_API int mxn_fit_chunk(int maxfev) { return jacobian_chunk(maxfev); }
|
|
293
|
+
MXN_API int mxn_fit_nfev(void) { return jacobian_get_nfev(); }
|
|
294
|
+
MXN_API double mxn_fit_residual_norm(void) { return jacobian_get_residual_norm(); }
|
|
295
|
+
/* All n_pars parameters, with the fitted ones at their current values. */
|
|
296
|
+
MXN_API void mxn_fit_params(double *out) { jacobian_get_params(out); }
|
|
297
|
+
/* Model values at the data points (n_targets * n_points, NaN for failed experiments). */
|
|
298
|
+
MXN_API int mxn_fit_predictions(double *out) { return jacobian_get_predictions(out); }
|
|
299
|
+
/* Residual Jacobian at the current parameters, column-major (n_targets * n_points, n_theta),
|
|
300
|
+
* with respect to the natural logarithm of log-fitted parameters. */
|
|
301
|
+
MXN_API int mxn_fit_jacobian(double *out) { return jacobian_get_jacobian(out); }
|
|
302
|
+
MXN_API void mxn_fit_free(void) { jacobian_free(); }
|
|
303
|
+
|
|
304
|
+
/* ------------------------------------------------------------------ */
|
|
305
|
+
/* Adjoint gradients */
|
|
306
|
+
/* ------------------------------------------------------------------ */
|
|
307
|
+
/* Exported wrappers around mxl-solvers' adjoint_wrapper.c: one forward and one backward solve
|
|
308
|
+
* per experiment give the gradient of sum(cotangent * model values) w.r.t. the parameters and
|
|
309
|
+
* the initial state. Global state like the fits, so only one runs at a time. */
|
|
310
|
+
void set_forward_model_fn(intptr_t fn);
|
|
311
|
+
void set_adjoint_fn(intptr_t fn);
|
|
312
|
+
int adjoint_vjp(int n_y, double *y0, int n_pars, double *pars, int n_theta, int *theta_idx,
|
|
313
|
+
int n_targets, int *target_kind, int *target_index, int n_ovr, int *ovr_idx,
|
|
314
|
+
int n_exp, int *exp_kind, int *exp_n_seg, int *exp_n_points, int n_seg_total,
|
|
315
|
+
double *seg_t_end, double *seg_ovr, int n_points, double *data_t,
|
|
316
|
+
double *cotangent, int n_derived, int solver_id, double rtol, double atol,
|
|
317
|
+
double ss_tol, double ss_t_max, double *out_pred, double *out_grad,
|
|
318
|
+
double *out_lambda0);
|
|
319
|
+
|
|
320
|
+
/* model: the model; adjoint: void(n, t, y, lambda, pars, dlambda, dtheta) writing
|
|
321
|
+
* -(df/dy)^T lambda and -lambda^T df/dtheta; derived / derived_grad as for mxn_fit_set_fns. */
|
|
322
|
+
MXN_API void mxn_adjoint_set_fns(intptr_t model, intptr_t adjoint, intptr_t derived,
|
|
323
|
+
intptr_t derived_grad) {
|
|
324
|
+
set_forward_model_fn(model);
|
|
325
|
+
set_adjoint_fn(adjoint);
|
|
326
|
+
set_derived_fn(derived);
|
|
327
|
+
set_derived_grad_fn(derived_grad);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/* Arguments as adjoint_vjp (adjoint_wrapper.c, fit_experiments.h's experiment layout), with the
|
|
331
|
+
* cotangent in data_y's layout. Returns 0, -1 out of memory, -3 inconsistent experiments, -4 a
|
|
332
|
+
* differentiated parameter is overridden, -5 derived targets without derived functions, -7
|
|
333
|
+
* functions not set, or a failed experiment's negative solver code. */
|
|
334
|
+
MXN_API int mxn_adjoint_vjp(int n_y, double *y0, int n_pars, double *pars, int n_theta,
|
|
335
|
+
int *theta_idx, int n_targets, int *target_kind, int *target_index,
|
|
336
|
+
int n_ovr, int *ovr_idx, int n_exp, int *exp_kind, int *exp_n_seg,
|
|
337
|
+
int *exp_n_points, int n_seg_total, double *seg_t_end, double *seg_ovr,
|
|
338
|
+
int n_points, double *data_t, double *cotangent, int n_derived,
|
|
339
|
+
int solver_id, double rtol, double atol, double ss_tol, double ss_t_max,
|
|
340
|
+
double *out_pred, double *out_grad, double *out_lambda0) {
|
|
341
|
+
return adjoint_vjp(n_y, y0, n_pars, pars, n_theta, theta_idx, n_targets, target_kind,
|
|
342
|
+
target_index, n_ovr, ovr_idx, n_exp, exp_kind, exp_n_seg, exp_n_points,
|
|
343
|
+
n_seg_total, seg_t_end, seg_ovr, n_points, data_t, cotangent, n_derived,
|
|
344
|
+
solver_id, rtol, atol, ss_tol, ss_t_max, out_pred, out_grad, out_lambda0);
|
|
345
|
+
}
|
|
346
|
+
|
|
239
347
|
#ifdef MXN_WASM
|
|
240
348
|
/* Model math stays inside wasm, rather than calling back into Python. */
|
|
241
349
|
#define F1(name) double mxn_##name(double x) { return name(x); }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Vendored from https://github.com/Computational-Biology-Aachen/mxl-solvers at
|
|
1
|
+
# Vendored from https://github.com/Computational-Biology-Aachen/mxl-solvers at 183c01543986ea804afaaeae797d01207c1c7fa7.
|
|
2
2
|
# Don't edit these files here: change mxl-solvers, then re-run its scripts/vendor.sh.
|
|
3
3
|
da5d9b896c422aa002b6d8fc3c7003a6e6345454afd700ae65fa3cd944ab12e5 radau5.c
|
|
4
4
|
8d2173c6ae898e77a71c2dc52e027ce2b6185d91170bd5f031b185aff6e1d354 dc_decsol.c
|
|
@@ -9,6 +9,27 @@ cf5d31866e63553809a79416b6baa957be45e3c03a5da59254fbbb317c735cfc f2c.h
|
|
|
9
9
|
751d5aa397f303b491d78f689dbf5b779f32b2d158b58c2b861d58143702e1f9 lsoda.h
|
|
10
10
|
8076d5b1bd27484ce6214cc5f9df7d6c88225182498538c9a878ed14d1743836 blaslapack_declarations.h
|
|
11
11
|
c615cf28e6d41f150f631d0b7fa73f6b2d8b694a88818a38851f54b0efec042c mxs_lapack.c
|
|
12
|
+
7d8f8f994e1c477fd023e0197fb7efde6287900010e96de3a3f188bc961cfb51 dop853.c
|
|
13
|
+
41652bfb7aa54277f9d2dff987a0c7cdbc63e68dac94a644daccf5c8ecd491b5 dopri5.c
|
|
14
|
+
78d34d672f5310c707bfed79d703c7fd3a8798872af32985f3924d3d43adf06f radau5_wrapper.c
|
|
15
|
+
1bbc4b4460dd58c8a7840b60df51dfe81c0cce8ac768eb15b3fb50d82146cb6b solver_common.c
|
|
16
|
+
f0a0dfe5b6796b71ff096f663ecfb8869770080ed7212ce1a97683e99c7918a1 solver_common.h
|
|
17
|
+
55c070b491fd31620bf0784a3c38535c293b210564acdd50bc062ff0945082b5 fit_experiments.c
|
|
18
|
+
9629a05dbd209b582d69dbf94c45392194d0bcb0fe3f7bad69e7e9e945f916af fit_experiments.h
|
|
19
|
+
ee273d15c2594e34c0abc8be341804c56e60cdb2377a563160e52e04168be414 jacobian_wrapper.c
|
|
20
|
+
8887036b1039e299ebcc8b95a73ea1538df548393fb8462361c80bea605a4fbe minpack/COPYRIGHT.txt
|
|
21
|
+
75538b4e14682e150d10a08b5aa2029d29cfc52095c78492606667bdb0973ada minpack/cminpack.h
|
|
22
|
+
fd9a039e295a835d7122d6335300c7a200dfac46cc27a01b641098f92764ad0b minpack/cminpackP.h
|
|
23
|
+
e06eb647cee0ff1b548718b289f72f1ef02e3e53621cdcd343fd1475796691da minpack/dpmpar.c
|
|
24
|
+
0544f8fae8145d5bc213c108926a2096487ca7b0e29524c0a79d1286b938b76e minpack/enorm.c
|
|
25
|
+
4dbe4f56e14fef106a28b7d967ad608b8c7b0b7063555a12b0471fe3dfd32fca minpack/fdjac2.c
|
|
26
|
+
0d4721d0d87b67ffc88101c6aa66921f180a398eee0e04cb3fe6468f73d9c105 minpack/lmder.c
|
|
27
|
+
d659e132db5cd9c9b61706397145e2005af0fef3b877c250fb31be5b382c795a minpack/lmdif.c
|
|
28
|
+
faac2ffbb50a7e0dad295bdf7f76e62fe625d3e6343ab1aa31b348d6fe5a411e minpack/lmpar.c
|
|
29
|
+
e69d3dde78e2724a74f0c94e328d38222aef85dd5f76dda49a3209d31eb4f58a minpack/minpackP.h
|
|
30
|
+
58079701d6d569e71888e9fb3446f7e691db8f73ae0d8096cdfd92311eb4b0c6 minpack/qrfac.c
|
|
31
|
+
fae6ee028024a1ea9f1fcf05cb0a840ee96c934aecd9e461d0266fda06b5abd1 minpack/qrsolv.c
|
|
32
|
+
3d71958c917a4f7eb85fdaeade0b274940a5e8b54b6c892dc877457c15b243d4 adjoint_wrapper.c
|
|
12
33
|
0e9a5c3ba2637f05909967c3eeeac9c7b9a4a4c6e92801a408afd2aa725024e2 sundials/include/cvode/cvode.h
|
|
13
34
|
adb1e5836989c630b595b14c0fa213426ddbfd3a87d14b581a470d5272b5881b sundials/include/cvode/cvode_diag.h
|
|
14
35
|
84dfab497850c933b8020cc0b2236a2e85bfe5fceffe4b5aefc8a1b518dd68a3 sundials/include/cvode/cvode_ls.h
|