Repository navigation
Releases: matthiaskoenig/sbmlode
Release list
0.3.0
Release notes for sbmlode 0.3.0
sbmlode 0.3.0 writes the ODE system of an SBML model as python code of JAX, which diffrax simulates: jax.jit compiles the simulation, jax.vmap batches it over constants and initial states, and jax.grad and jax.jacfwd differentiate it, a model with events included. It passes every case of the SBML test suite which it supports and libroadrunner simulates. sbmlode requires python 3.12 or newer, as jax does.
New features
- the format
diffrax(#8), written withsystem.write("model.py", fmt="diffrax")(.pystays the suffix ofpython):initial_values(p),f_dxdt(t, x, p)(a vector field of diffrax),f_y(t, x, p), the functions of the events, and withsimulator=Truesimulate(ts, p, x0, ...), which returns aSimulationof the output times, states, assigned values and constants, andto_frame, its pandasDataFrame; the file switches JAX to float64 on import - the events of SBML in JAX: delays, priorities, persistence, the initial values of the triggers, the values from the trigger time and cascades, on arrays of fixed shapes (
max_segments,max_pending), in loops of the kind theadjointof diffrax differentiates (RecursiveCheckpointAdjointforjax.grad,ForwardModeforjax.jacfwd,DirectAdjointfor both); the derivative includes the shift of an event time with the constants default_solver(),diffrax.Kvaerno5withChord, a chord method which ends at an increment belowkappa(patrick-kidger/diffrax#782); the steps of a model without events end at the output timesJaxPrinter, the dialectjaxof the math, which JAX traces:jnp.whereforpiecewise, the logic ofjnp, float literals andjnp.power- the extra
diffrax(jax, diffrax, equinox, optimistix, pandas), which the generated code runs with scripts/ode_report.py --format diffrax, the pass rate of the diffrax code over the SBML test suite: all 1481 cases which are supported and which libroadrunner simulates
Documentation
- a section of the guide on the diffrax code, with
jax.jit,jax.vmap,jax.gradandjax.jacfwdand a solve of one's own, the conventions of the formats in a compact table, the diffrax code of the repressilator and its row in the verification table - the design of the diffrax export,
docs/design/2026-10-06-diffrax-export-design.md
Breaking changes
- python 3.11 is no longer supported, sbmlode requires python 3.12 or newer
Your sbmlode team
0.2.0
Release notes for sbmlode 0.2.0
sbmlode 0.2.0 writes the ODE system in the native quantities of the SBML state variables: a species is a state in amount or in concentration as the model declares it, also in a compartment whose size changes. This changes the system and its typed target, see the breaking changes.
New features
- a species in concentration in a compartment whose size changes stays in concentration: its ODE is the one of SBML Level 3 Version 2, section 3.4.6, the reaction terms divided by the size minus the dilution
S/V dV/dt(Ode.size_rate); a boundary, constant or not reacting species in such a compartment keeps its amount and is diluted alone (origindilution) (matthiaskoenig/sbml4humans#114) - the rate of the size of a compartment
dV/dtis an assignment of its own (originsize_rate,OdeSystem.size_rates, a symbol of kindratewhose source is the compartment, typeset as the derivative of the compartment): the right hand side of its rate rule, or the derivative of its assignment rule by the chain rule; a size with an assignment rule of constants only is constant, a rule which cannot be differentiated is the unsupported constructrate of an assigned size astutil.derivative(ast, variable), the symbolic derivative of a math, simplified- an event which changes a size rescales every species in concentration of the compartment with the size after the event, also when it changes a parameter of the assignment rule of the size; the code writes the function
event_sizes_<id>of these sizes rateOfof a species in concentration in a variable compartment and of a size with an assignment rule
Documentation
- the logo of sbmlode in the README, the documentation, the release notes and as favicon
Breaking changes
OdeSystem.amounts,Quantity.amount_of,Ode.amount_of, the originconcentrationand the sectionamountsof the typed target and of the documents are removed, a species is never replaced by its amountn_STypesetEventAssignmenthas no fieldspecies, itsconversionisNoneorresized- the code context of an event assignment has
divisor_indexinto the new listsizesof the event instead ofdivisor_position
Your sbmlode team
0.1.0
Release notes for sbmlode 0.1.0
We are pleased to release the first version of sbmlode, the ODE export of sbmlutils as a package of its own. sbmlode writes the system of ordinary differential equations of an SBML model as python, julia and R code which simulates it and as typst, LaTeX and markdown documents which describe it. It depends on python-libsbml and jinja2 only, so that a tool which only needs the equations of a model, such as SBML4Humans, does not install the model building of sbmlutils.
New features
- the ODE export of sbmlutils 0.14.0 (
sbmlutils.converters.ode, matthiaskoenig/sbmlutils#492) as the packagesbmlode:OdeSystem.from_sbml(source),render(fmt, **options),write(path)andrender_template(template)in the formats python, julia, R, typst, LaTeX and markdown, with the same output apart from the line which names the version that wrote it OdeSystem.typeset(dialect, symbols, wrap)returns the typeset system as typed data instead of a document: the ODEs, the reaction rates, the assignment rules, the function definitions, the initial values and the events with their left hand sides and right hand sides in LaTeX or typst, which an application lays out itself; the documents of typst, LaTeX and markdown are rendered from itwrap(symbol, typeset)is called for every symbol the typeset math writes, including the ratevof a reaction and the amountnof a species, so that an application can turn a symbol into a link to its element;Symbol.elementnames the element of the model a symbol stands for, the reaction and the id of a local parameter which the analysis renames
Packaging and development
- the package reads and flattens a document with libsbml alone (
sbmlode.io) and writes the units of a model without pint (sbmlode.units) - the tests download the semantic cases of the SBML test suite 3.4.0 once into the cache directory, or read the directory
SBMLODE_TESTSUITEnames;SBMLODE_JULIAandSBMLODE_RSCRIPTset the commands of julia and R - continuous integration runs the suite on Linux, Windows and macOS, the generated R code with deSolve and the documents with tectonic and typst for every pull request, and the julia code for a release and on demand; the documentation is published at https://matthiaskoenig.github.io/sbmlode
Your sbmlode team