sbmlode 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. sbmlode-0.1.0/.gitignore +46 -0
  2. sbmlode-0.1.0/CITATION.cff +22 -0
  3. sbmlode-0.1.0/LICENSE +7 -0
  4. sbmlode-0.1.0/PKG-INFO +100 -0
  5. sbmlode-0.1.0/README.md +36 -0
  6. sbmlode-0.1.0/pyproject.toml +115 -0
  7. sbmlode-0.1.0/src/sbmlode/__init__.py +44 -0
  8. sbmlode-0.1.0/src/sbmlode/analysis.py +981 -0
  9. sbmlode-0.1.0/src/sbmlode/astutil.py +164 -0
  10. sbmlode-0.1.0/src/sbmlode/dependencies.py +77 -0
  11. sbmlode-0.1.0/src/sbmlode/documents.py +914 -0
  12. sbmlode-0.1.0/src/sbmlode/events.py +103 -0
  13. sbmlode-0.1.0/src/sbmlode/formats.py +978 -0
  14. sbmlode-0.1.0/src/sbmlode/io.py +152 -0
  15. sbmlode-0.1.0/src/sbmlode/printers/__init__.py +41 -0
  16. sbmlode-0.1.0/src/sbmlode/printers/base.py +1094 -0
  17. sbmlode-0.1.0/src/sbmlode/printers/document.py +279 -0
  18. sbmlode-0.1.0/src/sbmlode/printers/julia.py +180 -0
  19. sbmlode-0.1.0/src/sbmlode/printers/latex.py +141 -0
  20. sbmlode-0.1.0/src/sbmlode/printers/python.py +155 -0
  21. sbmlode-0.1.0/src/sbmlode/printers/r.py +166 -0
  22. sbmlode-0.1.0/src/sbmlode/printers/typst.py +129 -0
  23. sbmlode-0.1.0/src/sbmlode/symbols.py +518 -0
  24. sbmlode-0.1.0/src/sbmlode/system.py +471 -0
  25. sbmlode-0.1.0/src/sbmlode/templates/julia.jl.jinja +719 -0
  26. sbmlode-0.1.0/src/sbmlode/templates/latex.tex.jinja +199 -0
  27. sbmlode-0.1.0/src/sbmlode/templates/markdown.md.jinja +163 -0
  28. sbmlode-0.1.0/src/sbmlode/templates/python.py.jinja +683 -0
  29. sbmlode-0.1.0/src/sbmlode/templates/r.R.jinja +808 -0
  30. sbmlode-0.1.0/src/sbmlode/templates/typst.typ.jinja +175 -0
  31. sbmlode-0.1.0/src/sbmlode/text.py +247 -0
  32. sbmlode-0.1.0/src/sbmlode/units.py +198 -0
  33. sbmlode-0.1.0/tests/data/models/comp/dex_liver.xml +3251 -0
  34. sbmlode-0.1.0/tests/data/models/comp/icg_body.xml +2789 -0
  35. sbmlode-0.1.0/tests/data/models/comp/icg_body_flat.xml +3096 -0
  36. sbmlode-0.1.0/tests/data/models/comp/icg_liver.xml +548 -0
  37. sbmlode-0.1.0/tests/data/models/comp/spt_liver.xml +1155 -0
  38. sbmlode-0.1.0/tests/data/models/demo/Koenig_demo_v15.xml +720 -0
  39. sbmlode-0.1.0/tests/data/models/galactose/galactose_30.xml +4711 -0
  40. sbmlode-0.1.0/tests/data/models/interpolation/data1_linear.xml +366 -0
  41. sbmlode-0.1.0/tests/data/models/repressilator/BIOMD0000000012_urn.xml +1009 -0
  42. sbmlode-0.1.0/tests/data/models/van_der_pol/van_der_pol.xml +69 -0
  43. sbmlode-0.1.0/tests/data/unit_terms.json +662 -0
  44. sbmlode-0.1.0/tests/docker/r.Dockerfile +11 -0
  45. sbmlode-0.1.0/tests/golden/demo.md +107 -0
  46. sbmlode-0.1.0/tests/golden/demo.tex +149 -0
  47. sbmlode-0.1.0/tests/golden/demo.typ +143 -0
  48. sbmlode-0.1.0/tests/golden/events.md +123 -0
  49. sbmlode-0.1.0/tests/golden/events.tex +151 -0
  50. sbmlode-0.1.0/tests/golden/events.typ +132 -0
  51. sbmlode-0.1.0/tests/golden/events.xml +187 -0
  52. sbmlode-0.1.0/tests/golden/repressilator.md +206 -0
  53. sbmlode-0.1.0/tests/golden/repressilator.tex +245 -0
  54. sbmlode-0.1.0/tests/golden/repressilator.typ +238 -0
  55. sbmlode-0.1.0/tests/julia/Project.toml +16 -0
  56. sbmlode-0.1.0/tests/ode_helpers.py +1553 -0
  57. sbmlode-0.1.0/tests/resources.py +15 -0
  58. sbmlode-0.1.0/tests/test_ode_astutil.py +88 -0
  59. sbmlode-0.1.0/tests/test_ode_docs.py +78 -0
  60. sbmlode-0.1.0/tests/test_ode_julia.py +783 -0
  61. sbmlode-0.1.0/tests/test_ode_presentation.py +588 -0
  62. sbmlode-0.1.0/tests/test_ode_printers.py +1655 -0
  63. sbmlode-0.1.0/tests/test_ode_python.py +853 -0
  64. sbmlode-0.1.0/tests/test_ode_r.py +844 -0
  65. sbmlode-0.1.0/tests/test_ode_safety.py +800 -0
  66. sbmlode-0.1.0/tests/test_ode_symbols.py +467 -0
  67. sbmlode-0.1.0/tests/test_ode_system.py +1042 -0
  68. sbmlode-0.1.0/tests/test_ode_testsuite.py +494 -0
  69. sbmlode-0.1.0/tests/test_ode_text.py +110 -0
  70. sbmlode-0.1.0/tests/test_ode_typeset.py +133 -0
  71. sbmlode-0.1.0/tests/test_units.py +107 -0
  72. sbmlode-0.1.0/tests/testsuite.py +302 -0
  73. sbmlode-0.1.0/tox.ini +80 -0
@@ -0,0 +1,46 @@
1
+ # python
2
+ __pycache__/
3
+ *.pyc
4
+
5
+ # packaging artifacts (hatchling builds into dist/)
6
+ dist/
7
+ *.egg-info/
8
+
9
+ # environments, tool caches
10
+ .venv/
11
+ .tox/
12
+ .pytest_cache/
13
+ .ruff_cache/
14
+ .coverage
15
+ coverage.xml
16
+ # build cache of zensical
17
+ .cache/
18
+
19
+ # rendered documentation, built by the `documentation` workflow
20
+ site/
21
+
22
+ # py4cytoscape writes its log next to the working directory
23
+ logs/
24
+
25
+ # output of the examples, they write into the working directory
26
+ examples/**/results/
27
+ examples/**/_results/
28
+
29
+ # scratch directories of scripts/roundtrip_report.py, package_report.py and ode_report.py
30
+ .roundtrip_tmp/
31
+ .package_tmp/
32
+ .ode_tmp/
33
+ # the pages of the typst document of docs/ode.md, compiled by the docs workflow
34
+ docs/images/ode/*.svg
35
+
36
+ # working files of coding agents
37
+ .superpowers/
38
+
39
+ # editors, operating system
40
+ .idea/
41
+ .vscode/
42
+ *~
43
+ .DS_Store
44
+
45
+ # the julia environment of the tests is resolved from its Project.toml
46
+ tests/converters/ode/julia/Manifest.toml
@@ -0,0 +1,22 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use sbmlode, please cite it as below."
3
+ title: "sbmlode: ordinary differential equations of SBML models"
4
+ abstract: "sbmlode writes the system of ordinary differential equations of a model in the Systems Biology Markup Language (SBML) as python, julia and R code which simulates it and as LaTeX, typst and markdown documents which describe it."
5
+ type: software
6
+ authors:
7
+ - family-names: "König"
8
+ given-names: "Matthias"
9
+ orcid: "https://orcid.org/0000-0003-1725-179X"
10
+ affiliation: "Humboldt-University Berlin, Faculty of Life Science, Institute for Biology, Biology, Berlin; University Lübeck; University Hospital Schleswig-Holstein, Campus Lübeck, First Department of Medicine, Germany"
11
+ version: "0.1.0"
12
+ date-released: "2026-10-06"
13
+ license: MIT
14
+ repository-code: "https://github.com/matthiaskoenig/sbmlode"
15
+ url: "https://matthiaskoenig.github.io/sbmlode"
16
+ keywords:
17
+ - SBML
18
+ - Systems Biology Markup Language
19
+ - ODE
20
+ - ordinary differential equations
21
+ - code generation
22
+ - computational modeling
sbmlode-0.1.0/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2025 Matthias König
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
sbmlode-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.5
2
+ Name: sbmlode
3
+ Version: 0.1.0
4
+ Summary: sbmlode writes the ordinary differential equations of SBML models as python, julia and R code and as LaTeX, typst and markdown documents.
5
+ Project-URL: Homepage, https://matthiaskoenig.github.io/sbmlode
6
+ Project-URL: Documentation, https://matthiaskoenig.github.io/sbmlode
7
+ Project-URL: Repository, https://github.com/matthiaskoenig/sbmlode
8
+ Project-URL: Issues, https://github.com/matthiaskoenig/sbmlode/issues
9
+ Project-URL: Changelog, https://matthiaskoenig.github.io/sbmlode/release-notes/
10
+ Project-URL: Download, https://pypi.org/project/sbmlode
11
+ Author-email: Matthias König <konigmatt@googlemail.com>
12
+ Maintainer-email: Matthias König <konigmatt@googlemail.com>
13
+ License-Expression: MIT
14
+ License-File: LICENSE
15
+ Keywords: ODE,SBML,Systems Biology Markup Language,code generation,computational modeling,ordinary differential equations
16
+ Classifier: Development Status :: 4 - Beta
17
+ Classifier: Intended Audience :: Science/Research
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Programming Language :: Python :: 3.15
24
+ Classifier: Programming Language :: Python :: Implementation :: CPython
25
+ Classifier: Topic :: Scientific/Engineering
26
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
27
+ Classifier: Typing :: Typed
28
+ Requires-Python: >=3.11
29
+ Requires-Dist: jinja2>=3.1.6
30
+ Requires-Dist: python-libsbml>=5.21.2
31
+ Provides-Extra: dev
32
+ Requires-Dist: antimony!=3.2.0; (sys_platform == 'win32') and extra == 'dev'
33
+ Requires-Dist: antimony>=3.1.3; extra == 'dev'
34
+ Requires-Dist: bump-my-version>=1.5.1; extra == 'dev'
35
+ Requires-Dist: libroadrunner>=2.10.0; (python_version < '3.15') and extra == 'dev'
36
+ Requires-Dist: markdown-it-py>=3.0.0; extra == 'dev'
37
+ Requires-Dist: mkdocstrings-python>=2.0.8; extra == 'dev'
38
+ Requires-Dist: numpy>=2.2.2; extra == 'dev'
39
+ Requires-Dist: pandas>=2.2.2; extra == 'dev'
40
+ Requires-Dist: pre-commit>=4.6.2; extra == 'dev'
41
+ Requires-Dist: pytest>=9.1.1; extra == 'dev'
42
+ Requires-Dist: ruff>=0.16.6; extra == 'dev'
43
+ Requires-Dist: scipy>=1.15.0; extra == 'dev'
44
+ Requires-Dist: tox-uv>=1.29.0; extra == 'dev'
45
+ Requires-Dist: tox>=4.61.2; extra == 'dev'
46
+ Requires-Dist: ty>=0.0.79; extra == 'dev'
47
+ Requires-Dist: typst>=0.15.0; extra == 'dev'
48
+ Requires-Dist: zensical>=0.0.60; extra == 'dev'
49
+ Provides-Extra: simulate
50
+ Requires-Dist: numpy>=2.2.2; extra == 'simulate'
51
+ Requires-Dist: pandas>=2.2.2; extra == 'simulate'
52
+ Requires-Dist: scipy>=1.15.0; extra == 'simulate'
53
+ Provides-Extra: test
54
+ Requires-Dist: antimony!=3.2.0; (sys_platform == 'win32') and extra == 'test'
55
+ Requires-Dist: antimony>=3.1.3; extra == 'test'
56
+ Requires-Dist: libroadrunner>=2.10.0; (python_version < '3.15') and extra == 'test'
57
+ Requires-Dist: markdown-it-py>=3.0.0; extra == 'test'
58
+ Requires-Dist: numpy>=2.2.2; extra == 'test'
59
+ Requires-Dist: pandas>=2.2.2; extra == 'test'
60
+ Requires-Dist: pytest>=9.1.1; extra == 'test'
61
+ Requires-Dist: scipy>=1.15.0; extra == 'test'
62
+ Requires-Dist: typst>=0.15.0; extra == 'test'
63
+ Description-Content-Type: text/markdown
64
+
65
+ # sbmlode
66
+
67
+ [![PyPI](https://img.shields.io/pypi/v/sbmlode.svg)](https://pypi.org/project/sbmlode/) [![CI-CD](https://github.com/matthiaskoenig/sbmlode/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/matthiaskoenig/sbmlode/actions/workflows/ci-cd.yml) [![Documentation](https://img.shields.io/badge/docs-zensical-teal)](https://matthiaskoenig.github.io/sbmlode/)
68
+
69
+ An SBML model describes a system of ordinary differential equations (ODEs), but it is not written as one: the equations follow from the reactions, rules, events and units of the model. `sbmlode` derives this system once and writes it
70
+
71
+ - as **code** which simulates the model: **python** (numpy and scipy), **julia** (OrdinaryDiffEq.jl) and **R** (deSolve), verified against [libroadrunner](https://libroadrunner.org) over the [SBML test suite](https://github.com/sbmlteam/sbml-test-suite);
72
+ - as **documents** which describe the model: **typst**, **LaTeX** and **markdown**;
73
+ - as **typed data** for an application which lays out the equations itself, such as [SBML4Humans](https://sbml4humans.de), see [Typed target](https://matthiaskoenig.github.io/sbmlode/typeset/).
74
+
75
+ sbmlode depends on [python-libsbml](https://sbml.org/software/libsbml/) and jinja2 only. It is the ODE export of [sbmlutils](https://github.com/matthiaskoenig/sbmlutils) 0.14 as a package of its own, which sbmlutils re-exports as `sbmlutils.converters.ode`.
76
+
77
+ ## Installation
78
+
79
+ ```bash
80
+ pip install sbmlode # the export
81
+ pip install "sbmlode[simulate]" # with numpy, pandas and scipy, which the python code runs with
82
+ ```
83
+
84
+ ## Quick start
85
+
86
+ ```python
87
+ from sbmlode import OdeSystem
88
+
89
+ system = OdeSystem.from_sbml("model.xml")
90
+
91
+ code: str = system.render("python") # the code or document as a string
92
+ system.write("model.jl") # the format from the suffix of the file
93
+ system.write("model.md", standalone=False) # with the options of the format
94
+ ```
95
+
96
+ The [Guide](https://matthiaskoenig.github.io/sbmlode/formats/) describes the formats, their options, the supported SBML and the verification, the [API reference](https://matthiaskoenig.github.io/sbmlode/api/) the classes and functions.
97
+
98
+ ## License
99
+
100
+ sbmlode is open source under the [MIT license](https://github.com/matthiaskoenig/sbmlode/blob/develop/LICENSE). Please [open an issue](https://github.com/matthiaskoenig/sbmlode/issues) for a question or a problem.
@@ -0,0 +1,36 @@
1
+ # sbmlode
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/sbmlode.svg)](https://pypi.org/project/sbmlode/) [![CI-CD](https://github.com/matthiaskoenig/sbmlode/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/matthiaskoenig/sbmlode/actions/workflows/ci-cd.yml) [![Documentation](https://img.shields.io/badge/docs-zensical-teal)](https://matthiaskoenig.github.io/sbmlode/)
4
+
5
+ An SBML model describes a system of ordinary differential equations (ODEs), but it is not written as one: the equations follow from the reactions, rules, events and units of the model. `sbmlode` derives this system once and writes it
6
+
7
+ - as **code** which simulates the model: **python** (numpy and scipy), **julia** (OrdinaryDiffEq.jl) and **R** (deSolve), verified against [libroadrunner](https://libroadrunner.org) over the [SBML test suite](https://github.com/sbmlteam/sbml-test-suite);
8
+ - as **documents** which describe the model: **typst**, **LaTeX** and **markdown**;
9
+ - as **typed data** for an application which lays out the equations itself, such as [SBML4Humans](https://sbml4humans.de), see [Typed target](https://matthiaskoenig.github.io/sbmlode/typeset/).
10
+
11
+ sbmlode depends on [python-libsbml](https://sbml.org/software/libsbml/) and jinja2 only. It is the ODE export of [sbmlutils](https://github.com/matthiaskoenig/sbmlutils) 0.14 as a package of its own, which sbmlutils re-exports as `sbmlutils.converters.ode`.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install sbmlode # the export
17
+ pip install "sbmlode[simulate]" # with numpy, pandas and scipy, which the python code runs with
18
+ ```
19
+
20
+ ## Quick start
21
+
22
+ ```python
23
+ from sbmlode import OdeSystem
24
+
25
+ system = OdeSystem.from_sbml("model.xml")
26
+
27
+ code: str = system.render("python") # the code or document as a string
28
+ system.write("model.jl") # the format from the suffix of the file
29
+ system.write("model.md", standalone=False) # with the options of the format
30
+ ```
31
+
32
+ The [Guide](https://matthiaskoenig.github.io/sbmlode/formats/) describes the formats, their options, the supported SBML and the verification, the [API reference](https://matthiaskoenig.github.io/sbmlode/api/) the classes and functions.
33
+
34
+ ## License
35
+
36
+ sbmlode is open source under the [MIT license](https://github.com/matthiaskoenig/sbmlode/blob/develop/LICENSE). Please [open an issue](https://github.com/matthiaskoenig/sbmlode/issues) for a question or a problem.
@@ -0,0 +1,115 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "sbmlode"
7
+ dynamic = ["version"]
8
+ description = "sbmlode writes the ordinary differential equations of SBML models as python, julia and R code and as LaTeX, typst and markdown documents."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Matthias König", email = "konigmatt@googlemail.com" }]
14
+ maintainers = [{ name = "Matthias König", email = "konigmatt@googlemail.com" }]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Science/Research",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Programming Language :: Python :: 3.15",
24
+ "Programming Language :: Python :: Implementation :: CPython",
25
+ "Topic :: Scientific/Engineering",
26
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
27
+ "Typing :: Typed",
28
+ ]
29
+ keywords = [
30
+ "SBML",
31
+ "Systems Biology Markup Language",
32
+ "ODE",
33
+ "ordinary differential equations",
34
+ "code generation",
35
+ "computational modeling",
36
+ ]
37
+ dependencies = [
38
+ "python-libsbml>=5.21.2",
39
+ "jinja2>=3.1.6",
40
+ ]
41
+
42
+ [project.optional-dependencies]
43
+ # what the python code the export writes runs with: numpy and pandas, and scipy,
44
+ # which integrates it in `simulate`; sbmlode writes the code without them
45
+ simulate = ["numpy>=2.2.2", "pandas>=2.2.2", "scipy>=1.15.0"]
46
+ # what the tests need beyond the package: models written in antimony, the python
47
+ # simulator the export writes (`simulate`), the reference simulations of the SBML
48
+ # test suite (libroadrunner), the compilation of typst and the parsing of markdown
49
+ test = [
50
+ "sbmlode[simulate]",
51
+ "pytest>=9.1.1",
52
+ "antimony>=3.1.3",
53
+ # the win_amd64 wheel of antimony 3.2.0 raises a C++ exception in loadAntimonyString
54
+ "antimony!=3.2.0; sys_platform == 'win32'",
55
+ "libroadrunner>=2.10.0; python_version < '3.15'",
56
+ "typst>=0.15.0",
57
+ "markdown-it-py>=3.0.0",
58
+ ]
59
+ dev = [
60
+ "sbmlode[test]",
61
+ "bump-my-version>=1.5.1",
62
+ "ruff>=0.16.6",
63
+ "pre-commit>=4.6.2",
64
+ "ty>=0.0.79",
65
+ "tox>=4.61.2",
66
+ "tox-uv>=1.29.0",
67
+ "zensical>=0.0.60",
68
+ "mkdocstrings-python>=2.0.8",
69
+ ]
70
+
71
+ [project.urls]
72
+ Homepage = "https://matthiaskoenig.github.io/sbmlode"
73
+ Documentation = "https://matthiaskoenig.github.io/sbmlode"
74
+ Repository = "https://github.com/matthiaskoenig/sbmlode"
75
+ Issues = "https://github.com/matthiaskoenig/sbmlode/issues"
76
+ Changelog = "https://matthiaskoenig.github.io/sbmlode/release-notes/"
77
+ Download = "https://pypi.org/project/sbmlode"
78
+
79
+ [tool.hatch.version]
80
+ path = "./src/sbmlode/__init__.py"
81
+
82
+ [tool.hatch.build.targets.sdist]
83
+ # the package with what builds and tests it, nothing else of the repository
84
+ only-include = [
85
+ "src",
86
+ "tests",
87
+ "tox.ini",
88
+ "README.md",
89
+ "LICENSE",
90
+ "CITATION.cff",
91
+ ]
92
+
93
+ [tool.hatch.build.targets.wheel]
94
+ packages = ["src/sbmlode"]
95
+
96
+ [tool.pytest.ini_options]
97
+ testpaths = ["tests"]
98
+ # the tests import their helpers (`ode_helpers`, `testsuite`) and the scripts of
99
+ # the repository (`scripts.docs_images`)
100
+ pythonpath = [".", "tests"]
101
+ markers = [
102
+ "sbml_testsuite: full sweep over the SBML test suite, slow; deselect with -m 'not sbml_testsuite'",
103
+ ]
104
+
105
+ [tool.ty.environment]
106
+ # the package lives in the src layout; the checked python version is inferred
107
+ # from `project.requires-python` (i.e. the oldest supported version)
108
+ root = ["./src", "."]
109
+
110
+ [tool.ty.src]
111
+ include = ["src", "tests"]
112
+
113
+ [tool.ty.terminal]
114
+ # warnings are failures: keep the codebase free of any diagnostic
115
+ error-on-warning = true
@@ -0,0 +1,44 @@
1
+ """Export of an SBML model as its system of ordinary differential equations.
2
+
3
+ `OdeSystem.from_sbml` analyses a model into its ODE system, which is rendered in the
4
+ formats of `FORMATS`:
5
+
6
+ ```python
7
+ from sbmlode import OdeSystem
8
+
9
+ system = OdeSystem.from_sbml("model.xml")
10
+ code = system.render("python", simulator=True)
11
+ system.write("model.py")
12
+ ```
13
+
14
+ The methods `render`, `write` and `render_template` of `OdeSystem` are the functions of
15
+ the same names of this package, which take the system as their first argument.
16
+
17
+ The math of the model is written by the printers of `sbmlode.printers`,
18
+ one per dialect, the text of the model through the helpers of
19
+ `sbmlode.text`, the formats by `sbmlode.formats`:
20
+ python, julia and R code, and typst, LaTeX and markdown documents
21
+ (`sbmlode.documents`), e.g. `system.write("model.typ")`.
22
+ """
23
+
24
+ # the version comes first, the modules below read it when they render
25
+ __version__ = "0.1.0"
26
+
27
+ from sbmlode.formats import (
28
+ FORMATS,
29
+ Format,
30
+ render,
31
+ render_template,
32
+ write,
33
+ )
34
+ from sbmlode.system import OdeSystem
35
+
36
+ __all__: list[str] = [
37
+ "FORMATS",
38
+ "Format",
39
+ "OdeSystem",
40
+ "__version__",
41
+ "render",
42
+ "render_template",
43
+ "write",
44
+ ]