sbmlmath 0.4.1__tar.gz → 0.6.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 (46) hide show
  1. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/.github/workflows/ci.yaml +51 -24
  2. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/.github/workflows/deploy_release.yaml +5 -6
  3. sbmlmath-0.6.0/.github/workflows/prerelease.yaml +72 -0
  4. sbmlmath-0.6.0/MANIFEST.in +3 -0
  5. {sbmlmath-0.4.1/sbmlmath.egg-info → sbmlmath-0.6.0}/PKG-INFO +8 -3
  6. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/README.md +6 -1
  7. sbmlmath-0.6.0/doc/changelog.rst +4 -0
  8. sbmlmath-0.6.0/doc/development.rst +111 -0
  9. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/doc/index.rst +2 -0
  10. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/pyproject.toml +1 -1
  11. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/sbmlmath/__init__.py +1 -1
  12. sbmlmath-0.6.0/sbmlmath/mathml_parser.py +1042 -0
  13. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/sbmlmath/mathml_printer.py +68 -2
  14. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/sbmlmath/species_symbol.py +2 -2
  15. {sbmlmath-0.4.1 → sbmlmath-0.6.0/sbmlmath.egg-info}/PKG-INFO +8 -3
  16. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/sbmlmath.egg-info/SOURCES.txt +6 -2
  17. sbmlmath-0.6.0/sbmlmath.egg-info/scm_file_list.json +38 -0
  18. sbmlmath-0.6.0/sbmlmath.egg-info/scm_version.json +8 -0
  19. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/tests/test_misc.py +65 -2
  20. sbmlmath-0.6.0/tests/test_parser.py +851 -0
  21. sbmlmath-0.6.0/tests/test_printer.py +133 -0
  22. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/tests/test_species_symbol.py +15 -7
  23. sbmlmath-0.4.1/.gitignore +0 -9
  24. sbmlmath-0.4.1/doc/.gitignore +0 -3
  25. sbmlmath-0.4.1/sbmlmath/mathml_parser.py +0 -618
  26. sbmlmath-0.4.1/tests/test_parser.py +0 -57
  27. sbmlmath-0.4.1/tests/test_printer.py +0 -45
  28. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/.github/dependabot.yml +0 -0
  29. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/.pre-commit-config.yaml +0 -0
  30. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/.readthedocs.yml +0 -0
  31. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/CITATION.cff +0 -0
  32. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/LICENSE +0 -0
  33. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/doc/Makefile +0 -0
  34. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/doc/about.rst +0 -0
  35. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/doc/api.rst +0 -0
  36. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/doc/conf.py +0 -0
  37. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/doc/make.bat +0 -0
  38. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/doc/rtd_requirements.txt +0 -0
  39. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/sbmlmath/cfunction.py +0 -0
  40. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/sbmlmath/csymbol.py +0 -0
  41. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/sbmlmath.egg-info/dependency_links.txt +0 -0
  42. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/sbmlmath.egg-info/requires.txt +0 -0
  43. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/sbmlmath.egg-info/top_level.txt +0 -0
  44. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/setup.cfg +0 -0
  45. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/tests/test_csymbol.py +0 -0
  46. {sbmlmath-0.4.1 → sbmlmath-0.6.0}/tests/test_mathml_parser_sbml_semantic_suite.py +0 -0
@@ -12,35 +12,44 @@ jobs:
12
12
 
13
13
  strategy:
14
14
  matrix:
15
- python-version: ["3.9", "3.12"]
15
+ python-version: ["3.11", "3.15"]
16
16
 
17
17
  steps:
18
18
  - name: Check out repository
19
- uses: actions/checkout@v5
19
+ uses: actions/checkout@v7
20
20
 
21
21
  - name: Set up Python ${{ matrix.python-version }}
22
- uses: actions/setup-python@v6
22
+ uses: actions/setup-python@v7
23
23
  with:
24
24
  python-version: ${{ matrix.python-version }}
25
25
 
26
26
  - name: Cache pip
27
- uses: actions/cache@v4
27
+ uses: actions/cache@v6
28
28
  with:
29
29
  path: ~/.cache/pip
30
- key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
30
+ key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
31
31
  restore-keys: |
32
32
  ${{ runner.os }}-${{ matrix.python-version }}-
33
33
 
34
+ - name: Get SBML test suite revision
35
+ id: sbml-test-suite-rev
36
+ shell: bash
37
+ run: echo "sha=$(git ls-remote https://github.com/sbmlteam/sbml-test-suite HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
38
+
34
39
  - name: Cache / restore SBML test suite
35
40
  id: cache-sbml-test-suite
36
- uses: actions/cache@v4
41
+ uses: actions/cache@v6
37
42
  with:
38
43
  path: sbml-test-suite
39
- key: ${{ runner.os }}-sbml-test-suite
44
+ key: ${{ runner.os }}-sbml-test-suite-${{ steps.sbml-test-suite-rev.outputs.sha }}
40
45
 
41
46
  - name: Download SBML test suite
42
47
  if: steps.cache-sbml-test-suite.outputs.cache-hit != 'true'
43
- run: git clone --depth=1 https://github.com/sbmlteam/sbml-test-suite/
48
+ shell: bash
49
+ run: |
50
+ # only cases/semantic is needed
51
+ git clone --depth=1 --filter=blob:none --sparse https://github.com/sbmlteam/sbml-test-suite/
52
+ git -C sbml-test-suite sparse-checkout set cases/semantic
44
53
 
45
54
  - name: Install local packages
46
55
  run: |
@@ -59,35 +68,44 @@ jobs:
59
68
 
60
69
  strategy:
61
70
  matrix:
62
- python-version: ["3.9", "3.12"]
71
+ python-version: ["3.11", "3.15"]
63
72
 
64
73
  steps:
65
74
  - name: Check out repository
66
- uses: actions/checkout@v5
75
+ uses: actions/checkout@v7
67
76
 
68
77
  - name: Set up Python ${{ matrix.python-version }}
69
- uses: actions/setup-python@v6
78
+ uses: actions/setup-python@v7
70
79
  with:
71
80
  python-version: ${{ matrix.python-version }}
72
81
 
73
82
  - name: Cache pip
74
- uses: actions/cache@v4
83
+ uses: actions/cache@v6
75
84
  with:
76
85
  path: ~/.cache/pip
77
- key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
86
+ key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
78
87
  restore-keys: |
79
88
  ${{ runner.os }}-${{ matrix.python-version }}-
80
89
 
90
+ - name: Get SBML test suite revision
91
+ id: sbml-test-suite-rev
92
+ shell: bash
93
+ run: echo "sha=$(git ls-remote https://github.com/sbmlteam/sbml-test-suite HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
94
+
81
95
  - name: Cache / restore SBML test suite
82
96
  id: cache-sbml-test-suite
83
- uses: actions/cache@v4
97
+ uses: actions/cache@v6
84
98
  with:
85
99
  path: sbml-test-suite
86
- key: ${{ runner.os }}-sbml-test-suite
100
+ key: ${{ runner.os }}-sbml-test-suite-${{ steps.sbml-test-suite-rev.outputs.sha }}
87
101
 
88
102
  - name: Download SBML test suite
89
103
  if: steps.cache-sbml-test-suite.outputs.cache-hit != 'true'
90
- run: git clone --depth=1 https://github.com/sbmlteam/sbml-test-suite/
104
+ shell: bash
105
+ run: |
106
+ # only cases/semantic is needed
107
+ git clone --depth=1 --filter=blob:none --sparse https://github.com/sbmlteam/sbml-test-suite/
108
+ git -C sbml-test-suite sparse-checkout set cases/semantic
91
109
 
92
110
  - name: Install local packages
93
111
  run: |
@@ -103,35 +121,44 @@ jobs:
103
121
 
104
122
  strategy:
105
123
  matrix:
106
- python-version: ["3.9", "3.12"]
124
+ python-version: ["3.11", "3.15"]
107
125
 
108
126
  steps:
109
127
  - name: Check out repository
110
- uses: actions/checkout@v5
128
+ uses: actions/checkout@v7
111
129
 
112
130
  - name: Set up Python ${{ matrix.python-version }}
113
- uses: actions/setup-python@v6
131
+ uses: actions/setup-python@v7
114
132
  with:
115
133
  python-version: ${{ matrix.python-version }}
116
134
 
117
135
  - name: Cache pip
118
- uses: actions/cache@v4
136
+ uses: actions/cache@v6
119
137
  with:
120
138
  path: ~/.cache/pip
121
- key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
139
+ key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
122
140
  restore-keys: |
123
141
  ${{ runner.os }}-${{ matrix.python-version }}-
124
142
 
143
+ - name: Get SBML test suite revision
144
+ id: sbml-test-suite-rev
145
+ shell: bash
146
+ run: echo "sha=$(git ls-remote https://github.com/sbmlteam/sbml-test-suite HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
147
+
125
148
  - name: Cache / restore SBML test suite
126
149
  id: cache-sbml-test-suite
127
- uses: actions/cache@v4
150
+ uses: actions/cache@v6
128
151
  with:
129
152
  path: sbml-test-suite
130
- key: ${{ runner.os }}-sbml-test-suite
153
+ key: ${{ runner.os }}-sbml-test-suite-${{ steps.sbml-test-suite-rev.outputs.sha }}
131
154
 
132
155
  - name: Download SBML test suite
133
156
  if: steps.cache-sbml-test-suite.outputs.cache-hit != 'true'
134
- run: git clone --depth=1 https://github.com/sbmlteam/sbml-test-suite/
157
+ shell: bash
158
+ run: |
159
+ # only cases/semantic is needed
160
+ git clone --depth=1 --filter=blob:none --sparse https://github.com/sbmlteam/sbml-test-suite/
161
+ git -C sbml-test-suite sparse-checkout set cases/semantic
135
162
 
136
163
  - name: Install local packages
137
164
  run: |
@@ -16,19 +16,18 @@ jobs:
16
16
 
17
17
  steps:
18
18
  - name: Set up Python
19
- uses: actions/setup-python@v6
19
+ uses: actions/setup-python@v7
20
20
  with:
21
21
  python-version: "3.11"
22
22
 
23
- - uses: actions/checkout@v5
23
+ - uses: actions/checkout@v7
24
24
  with:
25
25
  fetch-depth: 20
26
26
 
27
- - name: Install dependencies
27
+ - name: Build sdist and wheel
28
28
  run: |
29
- python -m pip install --upgrade pip
30
- pip install setuptools wheel build
31
- python -m build -s
29
+ python -m pip install --upgrade pip build
30
+ python -m build
32
31
 
33
32
  - name: Publish a Python distribution to PyPI
34
33
  uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,72 @@
1
+ name: Prerelease dependencies
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ - cron: '17 5 * * 1'
7
+ push:
8
+ paths:
9
+ - .github/workflows/prerelease.yaml
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ deps: ["pre", "sympy-master"]
19
+
20
+ name: test (${{ matrix.deps }})
21
+
22
+ steps:
23
+ - name: Check out repository
24
+ uses: actions/checkout@v7
25
+
26
+ - name: Set up Python
27
+ uses: actions/setup-python@v7
28
+ with:
29
+ python-version: "3.15"
30
+
31
+ - name: Get SBML test suite revision
32
+ id: sbml-test-suite-rev
33
+ shell: bash
34
+ run: echo "sha=$(git ls-remote https://github.com/sbmlteam/sbml-test-suite HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
35
+
36
+ - name: Cache / restore SBML test suite
37
+ id: cache-sbml-test-suite
38
+ uses: actions/cache@v6
39
+ with:
40
+ path: sbml-test-suite
41
+ key: ${{ runner.os }}-sbml-test-suite-${{ steps.sbml-test-suite-rev.outputs.sha }}
42
+
43
+ - name: Download SBML test suite
44
+ if: steps.cache-sbml-test-suite.outputs.cache-hit != 'true'
45
+ shell: bash
46
+ run: |
47
+ # only cases/semantic is needed
48
+ git clone --depth=1 --filter=blob:none --sparse https://github.com/sbmlteam/sbml-test-suite/
49
+ git -C sbml-test-suite sparse-checkout set cases/semantic
50
+
51
+ - name: Install prerelease dependencies
52
+ if: matrix.deps == 'pre'
53
+ run: |
54
+ python -m pip install --upgrade pip setuptools
55
+ python -m pip install --upgrade --pre .[test]
56
+
57
+ - name: Install sympy master
58
+ if: matrix.deps == 'sympy-master'
59
+ run: |
60
+ python -m pip install --upgrade pip setuptools
61
+ python -m pip install .[test]
62
+ python -m pip install --upgrade "sympy @ git+https://github.com/sympy/sympy@master"
63
+
64
+ - name: Show installed versions
65
+ run: python -m pip list
66
+
67
+ - name: Unit tests
68
+ env:
69
+ SBML_TEST_SUITE_ROOT: "${{ github.workspace }}/sbml-test-suite/"
70
+ run: >
71
+ pytest -vv
72
+ -W error::sympy.utilities.exceptions.SymPyDeprecationWarning
@@ -0,0 +1,3 @@
1
+ # Exclude development files from packages
2
+ exclude .git_archival.txt
3
+ exclude .gitattributes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sbmlmath
3
- Version: 0.4.1
3
+ Version: 0.6.0
4
4
  Summary: SBML Math <-> SymPy
5
5
  Author-email: Daniel Weindl <sci@danielweindl.de>
6
6
  License-Expression: BSD-3-Clause
@@ -9,7 +9,7 @@ Project-URL: Documentation, https://sbmlmath.readthedocs.io/
9
9
  Project-URL: Repository, https://github.com/dweindl/sbmlmath.git
10
10
  Project-URL: Bug Tracker, https://github.com/dweindl/sbmlmath/issues
11
11
  Project-URL: PyPI, https://pypi.org/project/sbmlmath/
12
- Requires-Python: >=3.9
12
+ Requires-Python: >=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: python-libsbml>=5.20.4
@@ -73,7 +73,12 @@ Releases from [PyPI](https://pypi.org/project/sbmlmath/):
73
73
  pip install sbmlmath
74
74
  ```
75
75
 
76
+ Releases from [conda-forge](https://anaconda.org/conda-forge/sbmlmath):
77
+ ```bash
78
+ conda install conda-forge::sbmlmath
79
+ ```
80
+
76
81
  The latest development version from GitHub:
77
82
  ```bash
78
- pip install git+https://github.com/dweindl/sbmlmath.git#egg=sbmlmath
83
+ pip install git+https://github.com/dweindl/sbmlmath.git
79
84
  ```
@@ -50,7 +50,12 @@ Releases from [PyPI](https://pypi.org/project/sbmlmath/):
50
50
  pip install sbmlmath
51
51
  ```
52
52
 
53
+ Releases from [conda-forge](https://anaconda.org/conda-forge/sbmlmath):
54
+ ```bash
55
+ conda install conda-forge::sbmlmath
56
+ ```
57
+
53
58
  The latest development version from GitHub:
54
59
  ```bash
55
- pip install git+https://github.com/dweindl/sbmlmath.git#egg=sbmlmath
60
+ pip install git+https://github.com/dweindl/sbmlmath.git
56
61
  ```
@@ -0,0 +1,4 @@
1
+ Changelog
2
+ =========
3
+
4
+ See `https://github.com/dweindl/sbmlmath/releases <https://github.com/dweindl/sbmlmath/releases>`__.
@@ -0,0 +1,111 @@
1
+ Development
2
+ ===========
3
+
4
+ Contributing to sbmlmath
5
+ ------------------------
6
+
7
+ We welcome contributions from the community.
8
+ If you're interested in contributing to the project, please follow these steps:
9
+
10
+ 1. Fork the repository on GitHub.
11
+ 2. Create a new branch for your feature or bug fix.
12
+ 3. Make your changes and commit them with clear messages.
13
+ 4. Push your changes to your forked repository.
14
+ 5. Open a pull request against the main repository.
15
+
16
+ Before submitting a pull request, please ensure that your code adheres to the
17
+ project's coding standards and includes appropriate tests.
18
+
19
+ Use of AI tools
20
+ ^^^^^^^^^^^^^^^
21
+
22
+ You may use AI tools to help with your contribution, under these conditions:
23
+
24
+ * You understand and have reviewed every change you submit.
25
+ * You disclose any use of AI tools in the pull request description.
26
+ * You respond to reviews and discussions in issues and pull requests
27
+ yourself; do not post AI-generated replies.
28
+
29
+ We do not accept drive-by pull requests, i.e., AI-generated pull requests
30
+ whose author does not engage with them personally.
31
+ If a pull request merely relays between us and an AI tool,
32
+ it is easier for us to use the AI tool ourselves.
33
+ Such pull requests, and any others not meeting the conditions above,
34
+ may be closed without comment.
35
+
36
+
37
+ Development setup
38
+ -----------------
39
+
40
+ Install the package in editable mode with the test dependencies
41
+ and enable the `pre-commit <https://pre-commit.com/>`_ hooks
42
+ (linters and formatters):
43
+
44
+ .. code-block:: bash
45
+
46
+ pip install -e .[test]
47
+ pre-commit install
48
+
49
+
50
+ Running tests
51
+ -------------
52
+
53
+ We use `pytest <https://docs.pytest.org/en/stable/>`_ for testing.
54
+ This includes the doctests in ``sbmlmath/``.
55
+ To run the test suite, execute the following command in the project root
56
+ directory:
57
+
58
+ .. code-block:: bash
59
+
60
+ pytest
61
+
62
+ The tests based on the
63
+ `SBML Test Suite <https://github.com/sbmlteam/sbml-test-suite/>`_
64
+ are skipped unless ``SBML_TEST_SUITE_ROOT`` points to a checkout of it:
65
+
66
+ .. code-block:: bash
67
+
68
+ git clone --depth=1 https://github.com/sbmlteam/sbml-test-suite/
69
+ SBML_TEST_SUITE_ROOT=$(pwd)/sbml-test-suite pytest
70
+
71
+
72
+ Building the documentation
73
+ --------------------------
74
+
75
+ .. code-block:: bash
76
+
77
+ pip install -r doc/rtd_requirements.txt
78
+ cd doc && make html
79
+
80
+
81
+ Release process
82
+ ---------------
83
+
84
+ Releases are managed via GitHub releases.
85
+
86
+ To create a new release:
87
+
88
+ 1. Ensure that the tests on ``main`` pass
89
+ and that ``CITATION.cff`` is up to date.
90
+ 2. Go to the "Releases" section of the GitHub repository.
91
+ 3. Click on "Draft a new release".
92
+ 4. Fill in the tag version, release title, and description.
93
+
94
+ Version & tag: We follow `Semantic Versioning <https://semver.org/>`_.
95
+ The tag should be in the format ``vX.Y.Z`` (e.g., ``v1.0.0``).
96
+ The release title is ``sbmlmath vX.Y.Z``.
97
+ The package version will be automatically inferred from the tag
98
+ via `setuptools_scm <https://setuptools-scm.readthedocs.io/en/latest/>`__.
99
+
100
+ Description: Use "Generate release notes" and edit as needed.
101
+ The release notes serve as the changelog.
102
+
103
+ 5. Publish the release.
104
+
105
+ A GitHub Action workflow will automatically build and upload the package to
106
+ PyPI. Ensure that the action completes successfully.
107
+ Zenodo archives the release automatically.
108
+
109
+ 6. Merge the version update pull request that the conda-forge bot opens at
110
+ https://github.com/conda-forge/sbmlmath-feedstock.
111
+ Update the recipe if the dependencies have changed.
@@ -7,3 +7,5 @@
7
7
 
8
8
  About <about>
9
9
  API reference <api>
10
+ Development <development>
11
+ Changelog <changelog>
@@ -10,7 +10,7 @@ authors = [
10
10
  ]
11
11
  description = "SBML Math <-> SymPy"
12
12
  readme = "README.md"
13
- requires-python = ">=3.9"
13
+ requires-python = ">=3.11"
14
14
  license = "BSD-3-Clause"
15
15
  dependencies = [
16
16
  "python-libsbml>=5.20.4",
@@ -43,7 +43,7 @@ def sympy_to_sbml_math(sp_expr: sp.Expr) -> libsbml.ASTNode:
43
43
 
44
44
 
45
45
  def sbml_math_to_sympy(
46
- sbml_obj: Union[libsbml.SBase, libsbml.ASTNode], **kwargs
46
+ sbml_obj: libsbml.SBase | libsbml.ASTNode, **kwargs
47
47
  ) -> sp.Expr:
48
48
  """Convert SBML MathML to sympy expression.
49
49