Skip to content

Releases: matthiaskoenig/sbml2cellml

0.4.2

Choose a tag to compare

@github-actions github-actions released this 28 Sep 19:27
5795d27

Release notes for sbml2cellml 0.4.2

libopencor is installed from PyPI with the simulate extra (#54).

Changes

  • the simulate extra contains libopencor, which now publishes its wheels on PyPI (opencor/libopencor#595): pip install "sbml2cellml[simulate]" installs the CellML simulator, and so do the testsuite and dev extras. The wheels of the GitHub release of libopencor and the uv index for them are no longer needed
  • the error message of sbml2cellml.simulate without libopencor points at the simulate extra
  • updated development dependencies; libcellml 0.7.1 is still the latest release

Limitations

  • the unit check of the libcellml 0.7.1 analyser warns about consistent equations with units which have a multiplier and an exponent, e.g., per minute (cellml/libcellml#1463); the warnings do not make a model invalid
  • events, the delay symbol and coupled algebraic rules are not converted
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the conversion issues in the documentation

Your sbml2cellml team

0.4.1

Choose a tag to compare

@github-actions github-actions released this 19 Sep 16:16
e77f857

Release notes for sbml2cellml 0.4.1

The names, notes, SBO terms, annotations and the model history of an SBML model are converted: they go into an RDF file next to the CellML model and come back in the conversion to SBML (#44). Every reaction is a variable of its rate in the CellML model.

Features

  • sbml2cellml writes the metadata of the SBML model as model.rdf next to model.cellml. CellML 2.0 has no place for metadata in a model, only the id of an element for external metadata to point at, so the model, every variable and all units have an id, and model.cellml#<id> is the subject of an element in the RDF. The RDF is the one of SBML annotations (bqbiol and bqmodel qualifiers, the history with dcterms and vCard 4), written and parsed by libsbml, with the name as dcterms:title, the notes as dcterms:description (XHTML as XML literal) and the SBO term as the first bqbiol:is. See Metadata
  • cellml2sbml reads the file back and sets name, notes, SBO term, CV terms and history on the parameters, the unit definitions and the model, so the metadata survives the roundtrip
  • metadata=False of convert_sbml2cellml and convert_cellml2sbml and --no-metadata of both commands switch it off
  • every reaction with a kinetic law is a variable <reaction id> = kinetic law of its rate, and the differential equation of a species is the sum of the rates of its reactions instead of the kinetic laws. Before, only a reaction whose id a formula uses had the variable. The simulation results are the same, the equations are readable, and a reaction has an element for its metadata
  • the roundtrip example uses the complete BIOMD0000000012 with its notes and annotations and shows the RDF file and the metadata in the SBML model of the roundtrip
  • new module sbml2cellml.metadata

Changes

  • the CellML of a model with reactions differs from the one of 0.4.0: the rate variables, and the id attributes of the model, the variables and the units
  • sbml2cellml.cellml2sbml.build_document takes the metadata records as optional third argument

Fixes

  • a stoichiometry which is not set is 1 in SBML level 1 and 2; the warning that 1.0 is used appears only for level 3 models, where the value is unknown
  • name of the glimepiride repository in the conversion page of the documentation

Limitations

  • the names, notes and annotations of rules, function definitions, initial assignments, constraints and events have no CellML element and are not converted, neither are annotations which are not RDF
  • rateOf of a species in a compartment which an assignment or algebraic rule changes is not converted
  • libsbml does not take a number other than 1 as true when it evaluates an initial assignment (piecewise(0, 5, 1), case 01282 of the SBML test suite)
  • the unit check of the libcellml 0.7.1 analyser warns about consistent equations with units which have a multiplier and an exponent, e.g., per minute (cellml/libcellml#1463); the warnings do not make a model invalid
  • libsbml evaluates the rate rule of a variable as its value (sbmlteam/libsbml#491); the converter works around it since 0.3.3
  • events, the delay symbol and coupled algebraic rules are not converted
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the conversion issues in the documentation

Your sbml2cellml team

0.4.0

Choose a tag to compare

@github-actions github-actions released this 19 Sep 15:01
648653f

Release notes for sbml2cellml 0.4.0

The conversion of SBML to CellML keeps the amount of a species when its compartment changes, handles formulas as the MathML trees of the model instead of text and sets initial assignments which are NaN. 34 more cases of the SBML test suite and 15 more models of BioModels simulate in libopencor as in roadrunner, and the documentation has a roundtrip example.

Features

  • roundtrip example with the repressilator (BIOMD0000000012) in the documentation: the scripts, the SBML model, its CellML conversion and the SBML model of the roundtrip, and the simulations with roadrunner, libopencor and roadrunner side by side; examples/repressilator_example.py
  • a species in concentration whose compartment changes in time gets a second variable <species>_amount, which the reactions change, and the equation species = amount / compartment: SBML keeps the amount when the size changes, also of a species without reactions and of a constant or boundary species. A compartment which an assignment rule of constants sets (a volume from a body weight) does not change, such models convert as before
  • rateOf of a species in a changing compartment is converted when a rate rule changes the compartment
  • the initial size of a compartment which an assignment rule sets is the value of the rule and not the size attribute
  • an initial assignment which is NaN (NaN, 0 / 0, a formula with a variable which is NaN) sets its variable to NaN; libsbml leaves such assignments, the converter tells them apart from the ones libsbml cannot evaluate, which stay unconverted with a warning
  • new module sbml2cellml.astnodes, the construction of formulas as libsbml ASTs

Changes

  • the formulas of a model stay the ASTs libsbml reads, the reaction terms are built from nodes. The MathML of the converted models keeps the numbers and the nesting of the SBML model, so the CellML of a model may differ from the one of 0.3.5 in equivalent ways (-(2 * r) instead of (-2) * r)
  • the helpers of sbml2cellml.mathml take an AST or, as before, a formula as text
  • an initial assignment without math has no effect and is dropped without the warning that it was not converted
  • python-libsbml>=5.21.2

Fixes

  • the dilution of a concentration by a growing compartment was missing, the concentration was the state and only the reaction terms were divided by the size (28 cases of the SBML test suite)
  • an id which is a symbol of the formula syntax of libsbml (avogadro, pi, NaN, true) was converted as that symbol and not as the variable (cases 01761, 01763)
  • operators with one argument in function definitions did not convert (cases 01490, 01491)
  • a negative number and the negation of a product which starts with a negation are written such that the code libcellml generates compiles: libcellml 0.7.1 generates --2.0*a for -((-2) * a), a decrement in C

Limitations

  • rateOf of a species in a compartment which an assignment or algebraic rule changes is not converted
  • libsbml does not take a number other than 1 as true when it evaluates an initial assignment (piecewise(0, 5, 1), case 01282)
  • names, notes and annotations are not converted yet (#44)
  • the unit check of the libcellml 0.7.1 analyser warns about consistent equations with units which have a multiplier and an exponent, e.g., per minute (cellml/libcellml#1463); the warnings do not make a model invalid
  • libsbml evaluates the rate rule of a variable as its value (sbmlteam/libsbml#491); the converter works around it since 0.3.3
  • events, the delay symbol and coupled algebraic rules are not converted
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the conversion issues in the documentation

Your sbml2cellml team

0.3.5

Choose a tag to compare

@github-actions github-actions released this 19 Sep 12:54
b373415

Release notes for sbml2cellml 0.3.5

The reports of the SBML test suite and of BioModels show the complete error of every failing case and document the tolerances of the checks. The converters and their results are unchanged.

Features

  • the failure reasons of the reports list every failing case with its complete error: all issues of the validation of a CellML model, the code a compiler error of libopencor points at, every variable which exceeds the tolerance. Before, an error was one line cut at 400 characters, and the reports replaced quoted text by '...', cut a reason at 160 characters and listed ten cases per reason
  • the reports state how a simulation is compared, |value - expected| <= absolute + relative * |expected| with the tolerances of the settings of a case of the SBML test suite and with a relative tolerance of 1e-3 and an absolute tolerance of 1e-6 for BioModels, and the solver settings of the simulations (1e-9 relative and 1e-12 absolute, relaxed only when CVODE fails, 100000 internal steps between two time points). The numbers are rendered from the settings in the code

Changes

  • the first stage of the checks, the roadrunner simulation of the original SBML model, is named roadrunner instead of reference, in the reports, the figures and the results files testsuite/results.json and biomodels/results.json; reference_selections of sbml2cellml.testsuite.runner is roadrunner_selections
  • the message of a failed stage in the results files is the complete text of the exception with all its lines

Fixes

  • the development page gave the tolerances of the BioModels comparison as the tolerances of the SBML test suite, whose cases have their own
  • a compiler error of libopencor was reported as a line of the generated code (BIOMD0000000162)

Limitations

  • the unit check of the libcellml 0.7.1 analyser warns about consistent equations with units which have a multiplier and an exponent, e.g., per minute (cellml/libcellml#1463); the warnings do not make a model invalid
  • libsbml evaluates the rate rule of a variable as its value (sbmlteam/libsbml#491); the converter works around it since 0.3.3
  • events, the delay symbol and coupled algebraic rules are not converted
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the conversion issues in the documentation

Your sbml2cellml team

0.3.4

Choose a tag to compare

@github-actions github-actions released this 19 Sep 11:19
cfee446

Release notes for sbml2cellml 0.3.4

The simulations with CVODE are more robust. Of the 1060 manually curated models of BioModels which run, 908 simulate with libopencor like the roadrunner simulation of the original model (778 in 0.3.3), see the BioModels page.

Features

  • run_timecourse takes maximum_number_of_steps, the number of internal steps the solver may take between two time points of the output, 100000 by default. The 500 steps of libopencor ended the simulation of many models with mxstep steps taken before reaching tout, e.g., of 147 curated models of BioModels
  • the SBML test suite and BioModels checks repeat a simulation with relaxed tolerances (1e-8 relative and 1e-10 absolute, then 1e-7 and 1e-9) when CVODE gives up with the tight tolerances of the checks (1e-9 and 1e-12), for roadrunner and libopencor. Looser tolerances for every simulation are no alternative, results which pass would fail
  • tox r -e biomodels runs the local BioModels check in the locked environment

Changes

  • the full SBML test suite runs with python 3.14 only, in continuous integration and in the tox environment testsuite; the unit tests run with every supported python

Limitations

  • the unit check of the libcellml 0.7.1 analyser warns about consistent equations with units which have a multiplier and an exponent, e.g., per minute (cellml/libcellml#1463); the warnings do not make a model invalid
  • libsbml evaluates the rate rule of a variable as its value (sbmlteam/libsbml#491); the converter works around it since 0.3.3
  • events, the delay symbol and coupled algebraic rules are not converted
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the conversion issues in the documentation

Your sbml2cellml team

0.3.3

Choose a tag to compare

@github-actions github-actions released this 19 Sep 09:02
0da9977

Release notes for sbml2cellml 0.3.3

The manually curated models of BioModels are part of the documentation, and a wrong evaluation of initial assignments is fixed. Of the 1060 curated models which run, 1046 convert to valid CellML, 778 simulate with libopencor like the roadrunner simulation of the original model and 920 pass the roundtrip back to SBML, see the BioModels page.

Features

  • the results of the BioModels check are the BioModels page of the documentation, with a bar diagram of the models which pass, fail and skip every stage of the roundtrip, also in the README; sbml2cellml-biomodels run and report write the page and the diagram for light and dark backgrounds
  • the modules of sbml2cellml.biomodels are part of the API reference, the check is described in the development page

Fixes

  • SBML to CellML: a variable with an initial assignment and a rate rule got wrong initial values. libsbml evaluates such a variable by the math of its rate rule, so with x = 5 at the start and dx/dt = 3 an initial assignment q = 2 * x gave 6 instead of 10, and the conversion crashed when the rate depends on the variable, e.g., for BIOMD0000000429. The same happened for the algebraic rules solved at the start when a variable with a rate rule has no value. The rate rules are not part of the model anymore while libsbml evaluates the formulas

Changes

  • the BioModels check is run locally only: the biomodels workflow is removed, the report moved from biomodels/report.md to docs/biomodels.md

Limitations

  • the unit check of the libcellml 0.7.1 analyser warns about consistent equations with units which have a multiplier and an exponent, e.g., per minute (cellml/libcellml#1463); the warnings do not make a model invalid
  • events, the delay symbol and coupled algebraic rules are not converted
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the conversion issues in the documentation

Your sbml2cellml team

0.3.2

Choose a tag to compare

@github-actions github-actions released this 19 Sep 07:00
89a322d

Release notes for sbml2cellml 0.3.2

Units are converted in both directions, and the release notes are part of the documentation. The glimepiride example models, which have a complete unit annotation and units on numbers, all convert to valid CellML and simulate with libopencor now.

Features

  • SBML to CellML: every unit definition becomes CellML units of the same name; the unit kinds item and avogadro, which CellML lacks, become new base units and dimensionless units
  • SBML to CellML: the numbers in formulas keep their units, e.g., 2 mM; they referenced units which did not exist in the CellML model before, which made a model invalid
  • SBML to CellML: the variables get the units of their compartment, parameter, local parameter, species (substance per size of the compartment for a concentration) or reaction (extent per time) when the unit annotation of the model is complete, including the built-in units of SBML level 1 and 2. With a variable without units all variables stay dimensionless, a warning names the variables
  • CellML to SBML: the units of the numbers are part of the SBML math
  • CellML to SBML: new base units item become the SBML unit kind item
  • the release notes are part of the documentation, see Release notes

Fixes

  • CellML to SBML: the multiplier of a unit with an exponent was copied, but CellML applies the exponent to the prefix only, SBML to the multiplier as well: 1/60 second^-1 (per minute) became 60 per second. The SBML multiplier is multiplier^(1/exponent) now, and the prefix of a reference to custom units is raised to the exponent
  • CellML to SBML: a factor which cannot be folded into a unit, e.g., of a unit with the exponent 0, becomes a dimensionless unit instead of an error
  • the units per_second, which no variable used, are no longer added to every CellML model

Changes

  • the release notes moved from release-notes/ to docs/release-notes/

Limitations

  • the unit check of the libcellml 0.7.1 analyser warns about consistent equations with units which have a multiplier and an exponent, e.g., per minute (cellml/libcellml#1463); the warnings do not make a model invalid
  • events, the delay symbol and coupled algebraic rules are not converted
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the conversion issues in the documentation

Your sbml2cellml team

0.3.1

Choose a tag to compare

@github-actions github-actions released this 19 Sep 05:39
d46d2ce

Release notes for sbml2cellml 0.3.1

Documentation release with a graphical overview of the SBML test suite results, together with the conversions added since 0.3.0. Of the 1535 runnable cases of the SBML test suite, 1462 convert to valid CellML (1420 in 0.3.0) and 1010 simulate with libopencor like the expected results (857 in 0.3.0), see the SBML test suite page.

Features

  • bar diagram of the SBML test suite results, i.e., the cases which pass, fail and skip every stage of the roundtrip, in the README and on the SBML test suite page; sbml2cellml-testsuite run and report write it for light and dark backgrounds (sbml2cellml.testsuite.figure)
  • the tables of the SBML test suite report list the total number of cases, the failure reasons of a stage start with its number of failed cases
  • algebraic rules are converted in both directions: an SBML algebraic rule becomes an implicit CellML equation, an implicit CellML equation an SBML algebraic rule
  • the rateOf symbol is replaced by the right-hand side of the differential equation of its variable
  • the conversion factors of species and the model are applied to the reaction terms
  • plus, times, and, or and xor with less than two arguments are replaced by their value

Fixes

  • a rule or kinetic law without math no longer fails the conversion, it is ignored
  • documentation: the headings of the conversion page were missing in the page navigation (the page had two top level headings), and pages outside of a section looked like members of the section above them; every page is part of a section now
  • documentation: the PyPI badges use the current shields.io routes

Changes

  • documentation: the roadmap became the conversion issues page, which only lists the remaining issues
  • documentation: the simulation page covers the simulation of SBML with roadrunner and of CellML with libopencor with the setup of both optional simulators

Limitations

  • events, the delay symbol and coupled algebraic rules are not converted
  • units are not converted, every variable is dimensionless; numbers with the units of an SBML unit definition are not supported
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the conversion issues in the documentation

Your sbml2cellml team

0.3.0

Choose a tag to compare

@github-actions github-actions released this 18 Sep 23:04
072e79b

Release notes for sbml2cellml 0.3.0

Much wider coverage of SBML in the conversion to CellML. Of the runnable cases of the SBML test suite, 1420 convert to valid CellML (458 in 0.2.0) and 857 simulate with libopencor like the expected results (137 in 0.2.0), see the SBML test suite page.

Features

  • function definitions: their calls are replaced by the bodies of the functions
  • initial assignments are evaluated to initial values (an assignment to NaN is not)
  • local parameters of kinetic laws become variables <reaction>_<parameter>
  • species reference ids (stoichiometries, which rules may set) and reaction ids (rates) in formulas become variables
  • the time and avogadro symbols in formulas
  • numbers without units in formulas are dimensionless, integers and rationals are written as real numbers
  • models without differential equations are converted as algebraic models without the variable of integration time; run_timecourse returns their steady state values at every requested time point
  • an infinite or NaN value of a variable which is not a state becomes an equation

Fixes

  • kinetic laws are multiplied with their stoichiometry, which was ignored
  • reactions no longer change boundary species
  • a local parameter takes precedence over a global parameter of the same id in its kinetic law
  • the target of an assignment rule has no initial value, which the libcellml 0.7 analyser rejected as underconstrained (e.g., the glimepiride kidney model is valid again)
  • an SBML value set to NaN is no longer replaced by 1.0 like an unset value
  • run_timecourse raises a SimulationError when two result columns get the same name instead of silently replacing one of them
  • a recursive function definition no longer crashes the conversion: libsbml (5.21) segfaults when it expands the function definitions or initial assignments of such a document, which is therefore checked first

Limitations

  • events, algebraic rules, the delay and rateOf symbols and species conversion factors are not converted
  • units are not converted, every variable is dimensionless; numbers with the units of an SBML unit definition are not supported
  • Windows is not supported, the Windows wheels of libcellml 0.7.1 contain ARM64 binaries
  • see the roadmap in the documentation

Your sbml2cellml team

0.2.0

Choose a tag to compare

@github-actions github-actions released this 18 Sep 13:33
7e252fe

Release notes for sbml2cellml 0.2.0

Port to libcellml 0.7 and support of python 3.14.

Features

  • python 3.14 is supported (3.13 and 3.14 are tested on Linux and macOS)

Fixes

  • cellml2sbml works with libcellml 0.7: sbml2cellml 0.1.0 declared libcellml>=0.6.3, so a new installation got libcellml 0.7.1, whose changed analyser API made cellml2sbml fail with AttributeError: 'Analyser' object has no attribute 'model'. The converted SBML is unchanged.

Changes

  • requires libcellml 0.7.1 or newer
  • the libcellml 0.7 analyser reports an assignment rule target with an initial value as underconstrained, so the validation of sbml2cellml rejects such models now, e.g., the glimepiride kidney model; they failed later before (in the simulation or in cellml2sbml). See the roadmap in the documentation
  • Windows is currently not supported: the Windows wheels of libcellml 0.7.1 contain ARM64 binaries, which do not load on x64 Windows (cellml/libcellml#1460)

Your sbml2cellml team