Repository navigation
Release notes for sbmlsim 0.22.0
A single least squares optimization now uses every core: the points of the finite differences of its jacobian are evaluated on the workers of the fit, which is the whole cost of a fit of many parameters. A fit of one start on twelve cores ran in 390 s instead of 6124 s on the machine perfusion model of pkdb_models (35 parameters, 498 residuals, 45 fit mappings), and a multistart of six starts in 35 minutes instead of an estimated 10 hours.
Results which change: none. The points of a jacobian are evaluated at the same step whether they run in the calling process or on workers, so the jacobian of a fit on workers is the jacobian of a serial fit bitwise, and a fit of a seed takes the same path and reaches the same optimum on any number of cores.
Features
- A least squares run evaluates its jacobian on the workers of the fit (#505).
split_coresofsbmlsim.fit.runnergives the workers either to the runs of a fit or to the evaluations of a single run, which until now meant the population of differential evolution only: a fit of least squares with fewer runs than the jacobian of a run is wide runs its runs one after another and evaluates thenresidual vectors of every jacobian on all workers (JacobianPool, theworkersofscipy.optimize.least_squares,OptimizationProblem.jacobian_map). A run spreads over as many workers as its jacobian has points (jacobian_width, one point per parameter forjac="2-point", two for3-point), so a fit of two parameters on twelve workers still runs its runs in parallel, and a jacobian of the caller spreads over nothing. The workers initialize the problem before the budget of a run as they do for a population, the cost of every point is recorded in the trajectory in the order of the points, andworkersof SciPy is refused for either optimizer, except its defaults1andNone:n_coresgives the workers. - A profile of few parameters uses every core (#505).
profile_likelihoodofsbmlsim.fit.identifiabilitysplits its cores the same way: an analysis of fewer scans than the jacobian of a re-optimization is wide, e.g. a profile of a single parameter withpids, runs its scans in the calling process and evaluates the points of the jacobian of every re-optimization on the workers. Until now the scans were the only parallelism, so a profile of one parameter used two cores whatever--coressaid. import sbmlsimchecks the installed libroadrunner (sbmlsim.engine.check_roadrunner). sbmlsim simulates with a build of thedevelopbranch of libroadrunner, which is not on PyPI, and another libroadrunner, e.g. the release of PyPI, loads the models and simulates them with other rows at the events and the changes of a simulation: a wrong install showed up as wrong results and not as an error. The import now compares the installed libroadrunner with the requirement of the metadata of the package and raises anImportErrorwhich names the commands of Installation, the build from the index of the builds and then sbmlsim;SBMLSIM_SKIP_ROADRUNNER_CHECK=1switches the check off, e.g. for a libroadrunner built from source. The check reads the metadata of two distributions and imports no roadrunner, 3 ms of an import of 650 ms.- The install instructions name libroadrunner first (Installation). Every install of the documentation, of
scripts/published_install.pyand of the jobs of the continuous integration now installs the build of libroadrunner from the index of the builds first (pip install --no-deps --index-url <index> "libroadrunner>=2.11.1.dev655") and then sbmlsim from PyPI, whose requirement the installed build satisfies, instead of asking the index for every package of one install with--extra-index-url, which GitHub Pages answers with a503now and then.
Fixes
- The tox environments install again. tox-uv installs the dependencies of the package with
uv pip install, which reads neithertool.uv.sourcesnortool.uv.indexof the project, so the floorlibroadrunner>=2.11.1.dev655of 0.21.0 could not be resolved and every environment failed before its first test.tox.inigives the index of the builds of libroadrunner to the environments (set_env = UV_INDEX = ...); the environments still resolve frompyproject.tomland not fromuv.lock.
Dependencies
packaging>=25.0is a dependency of its own:sbmlsim.engine.check_roadrunnercompares the installed libroadrunner with the requirement of the package withpackaging.version. It is installed in every environment already, as a dependency of matplotlib and h5netcdf.- The
workersofscipy.optimize.least_squaresis part of SciPy since 1.16 andscipy>=1.18.1was already required. simrun>=0.3.2of thesimrunextra, the latest release of simrun, which the lock resolved already: 0.3.1 made the images and the runs on a k3d cluster faster and 0.3.2 is its release for the tests, the package of 0.3.1.