pypi sbmlsim 0.24.0

35 minutes ago

Release notes for sbmlsim 0.24.0

sbmlsim

A model carries its interactive panels. The SBML of a model declares the panels a reader can play with (the knobs, the curves, the study data under them and the pages of an app of them) in an annotation of its own namespace, and python -m sbmlsim.serve simulates them on request, so one set of web components, sbmlsim-web, can embed a model on a page of documentation, a slide or a course instead of a web app per model.

Results which change: the formulas of PEtab math. A number of a formula is now the double of its text and an operation the one written, so x / 90 is one division and no longer a multiplication with a reciprocal of 15 digits, min(45 / 90, 1) is 0.5 and no longer 0.49999999999999944; observables, Data functions, changes, the pre-initialization and the noise models of a fit which divide by a number move in their last digits.

Features

  • Interactive panels of a model (#518). sbmlsim.panel declares a Panel (knobs as ranges with named stops or as choices, at most 8, a knob which only feeds the formulas of PanelSimulation.derived; curves with unit and scale; study data with the state of the knobs it was measured under; one simulation; fixed axes) and the App of a model (pages of panels with scenarios, variants, citation, DOI and licenses), with the versioned wire contracts panel/1, app/1 and paneldata/1. sbmlsim.panel_sbml reads and writes the declaration as an annotation of the <model> (https://sbmlsim.org/ns/panel/1) with libsbml alone; the declaration of a variant is the one of its own SBML, and Project.panels and Project.variant_panels override it. docs/serve.md documents the declaration, the annotation, the contracts and a deployment; examples/panels/ is the HCTZ demo.
  • The service of the panels (#518), the new extra web. python -m sbmlsim.serve --model id=module:attribute serves the models, the app of a model with the knobs its pages share and the heads of their panels, the panels and their study data per variant and their simulations. It checks every panel of every variant at startup (the targets are entities of the model, the derived formulas compile over the knob ids, a knob shared by the panels of a page is declared alike, the scenarios are valid), answers a value a knob does not take with a 422, runs the scan of a state of the knobs once for the panels of a page which share a simulation (with roadrunner, where it is bitwise the run of each panel alone), refuses a ninth waiting request of a model with a 503 and Retry-After, keeps its answers in caches bounded in bytes and serves the runs of the simulation experiments of a model as jobs only when it is started with --experiments.
  • The citation of a release (#518). ReleaseSettings.citation formats the citation the release writes into its README and documentation, so an app cites the release in the same words.

Fixes

  • A number of a PEtab formula is the double of its text (#516). compile_formula lambdified the expression of the parser of PEtab, which sympy evaluates on construction with numbers of 15 digits. The numpy function is now written from the parse tree with the meaning the math of SBML has in sbmlsim: the numbers as doubles, the operations as written, every input a double of numpy, so a division by zero is infinity and the root of a negative number NaN, as in the events. A formula reads every identifier it names, x - x reads x, and a formula whose units only agreed after sympy folded a term away needs its unit=.
  • A worker of a pool takes SIGTERM (#517). A worker of forkserver inherits the signal mask of the thread which started the forkserver; a pool started from a thread which blocks SIGTERM had workers which never took it, so a pool which broke waited for them forever (the hang of test_a_worker_which_died_loses_no_point under xdist). The initializer of a worker unblocks SIGTERM with SIGINT.
  • The CI of a release builds h5py on python 3.15 (#515), installing the library of HDF5 as the test matrix does.

Dependencies

  • the extra web: fastapi>=0.121.0, starlette>=1.10.0, uvicorn>=0.41.0, anyio>=4.6.0 and httpx2>=2.16.0, the client of the test client of starlette; dev installs it, and the tox environments install web and zensical.

Don't miss a new sbmlsim release

NewReleases is sending notifications on new releases.