Skip to content

0.8.0

Choose a tag to compare

@github-actions github-actions released this 06 Oct 14:37
· 7 commits to develop since this release
f3a3dd3

Release notes for sbmlsim 0.8.0

sbmlsim

A feature release: hybrid problems of an SBML model and neural networks (PEtab SciML), simulations without intermediate data frames, reports which show their figures again, and every dependency at its latest release.

Features

  • PEtab SciML: hybrid problems of an SBML model and neural networks (#207, #226). Problems of PEtab SciML, in which an SBML model is hybridized with neural networks, are read, simulated with roadrunner, evaluated, fitted and written back. sbmlsim.sciml (the extra sciml: petab-sciml, h5py, pyyaml) holds Network with its files, its forward pass in numpy and the ids of its elements, the layers of the format (convolution, pooling, normalization, Linear, Bilinear, Flatten, the activations), Hybridization with its three patterns, and compile_network, which writes a feed-forward network into the SBML model as parameters with assignment rules. A network before the simulation runs in numpy and sets changes of the simulation, a network in the right hand side or in an observable is simulated by roadrunner
  • the fit of a hybrid problem: derived changes of a problem (OptimizationProblem(hybridizations=...)), FitParameter.scale per parameter, infinite bounds on the linear scale, SamplingType.START and Hybridization.fit_parameters; a hybrid fit is defined in python without PEtab and runs in parallel
  • the PEtab v2 layer: log_likelihood and gradient of a problem with the noise models of PEtab v2, the reader of PEtab SciML problems (without torch), the export of hybrid problems with an exact round trip, to_petab(parameter_set=...) and the record of a derived model (model/provenance.py); a foreign extension with required: true is refused
  • the PEtab SciML test suite runs pinned by its commit (tox r -e sciml, and the testsuite job of a release): ml_model_import 53 of 54, initialization 3 of 3, sciml_problem_import 36 of 39 (032 to 034 need priors, #190), and the 36 problems which are read are written back exactly
  • the console and the report of a fit show a network as one row per array, the networks are in the overview, the bound warnings and the Fisher table are per array and the profiles default to the parameters which are no elements of a network
  • the examples examples/sciml/: the Lotka-Volterra problem of the test suite read, fitted and written, and a neural ODE defined in python and fitted in parallel; PEtab documents the layers

Performance

  • simulations answer with the arrays of roadrunner instead of data frames (#215, #228). A timecourse built a pandas DataFrame per timecourse, concatenated the frames and looked their columns up again, which took a third of the time of the residuals of a fit and half of the time of a scan. TimecourseResult (sbmlsim.result) is the array roadrunner returns with the names of its columns, XResult.from_timecourses places the results of a scan with one assignment per simulation, and the residuals of a fit read the columns as views: the residuals of the HCTZ PK problem take 17.2 ms instead of 21.3 ms and a scan of 200 timecourses 475 ms instead of 670 ms, with identical results. pandas stays for the tables of the reports and for DataSet. polars was evaluated and is slower than pandas for these frames; numba was evaluated for the fits and the sensitivity analyses (#217) and is not used, since the integration by roadrunner is 86% of a fit and 91% of a sensitivity analysis

Fixes

  • the reports of the experiments show their figures (#221, #230). The index of the HTML report used the description of a figure as the path of its image and showed no figure, the LaTeX report failed copying the figures, and the markdown report did not render its index and referred to images at the root of the file system, which the preview of VS Code does not show. The markdown pages are written with paths relative to the page, the LaTeX report includes the copied images from <filename>_figures/ unless a latex_path_prefix is given and leaves a figure without a png out with a warning; a figure of one panel is no longer stretched to the width of the page and models and code are shown by their file name
  • the residuals no longer depend on earlier evaluations. The absolute tolerance of the integrator was scaled by the compartment volumes of the current state, so the first evaluation of every fit integrated at 1e-18; it is scaled by the smallest finite positive initial volume
  • the profile likelihood converted its values with 10**theta whatever the scale of the parameters, so the profiles of a fit on the linear scale were wrong
  • an export after an evaluation of a problem wrote the values of the parameters as conditions; the reader merged an observable measured in two experiments into one dataset and handed the natural log of PEtab to the decadic log of the formula parser of SBML; the JSON of a problem with its experiment classes could not be written
  • optimization_result.tsv is a table with one line per run and one column per parameter, the arrays were printed over several lines
  • a case of the SBML Test Suite whose variables are named like the time column is compared on its variables instead of being reported as missing (#216)
  • load_pkdb_dataframe raises a FileNotFoundError naming every path when a dataset is in none of the data paths, it created a ValueError without raising it; DataSet.from_df adds the units of the udict as *_unit columns, it set them as attributes of the frame where they were lost; species_df had a column species without data
  • the Sobol analysis samples with SALib.sample.sobol instead of the deprecated saltelli, which changes the numbers of the sensitivity example; the tests run without warnings
  • the example of the simple chain writes its ODEs with sbmlode, sbmlutils.converters.odefac no longer exists; the tests of the example scripts read the output of a script as utf-8 on windows

Changes of interfaces

  • SimulatorSerial._timecourses returns TimecourseResult instead of DataFrame, sbmlsim.testsuite.simulate_case returns a TimecourseResult and compare_case takes one; XResult.from_dfs is kept and converts the frames
  • DEFAULT_EXPERIMENT of the PEtab layer is default_experiment, a PEtab model named model collided with it
  • the sbmlsim extension of an exported problem is version 0.2.0 (observables keyed by the fit mapping, scale per parameter, inputs), 0.1.0 is still read
  • optimization_result.tsv has the columns x0.<pid> instead of x and x0

Dependencies

  • sbml4humans (>=0.12.2, human readable reports of SBML models) and pkpdutils (>=1.3.0, pharmacokinetic and pharmacodynamic analysis of timecourses) are dependencies (#229)
  • sbmlmath>=0.4.1,<0.5 is a declared dependency; torch is only in the dev extra, as the CPU build, the package never imports it
  • every dependency at its latest release: sbmlutils 0.16.0 (the ODE export moved to sbmlode), pymetadata 0.8.0, python-libsbml 5.21.2, python-libsedml 2.0.34, SALib 1.6.0, pandas 3.0.6, xarray 2026.9.0, pint 0.26.1 and matplotlib 3.11.2