SimBio 1.0.0b2__tar.gz → 1.0.1__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 (28) hide show
  1. {simbio-1.0.0b2 → simbio-1.0.1}/PKG-INFO +3 -107
  2. simbio-1.0.1/README.md +100 -0
  3. {simbio-1.0.0b2 → simbio-1.0.1}/pyproject.toml +3 -3
  4. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/__init__.py +5 -1
  5. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/reactions/__init__.py +10 -10
  6. simbio-1.0.0b2/README.md +0 -204
  7. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/core.py +0 -0
  8. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/__init__.py +0 -0
  9. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/biomodels.py +0 -0
  10. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/graph/networkx.py +0 -0
  11. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/mathML/__init__.py +0 -0
  12. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/mathML/exporter.py +0 -0
  13. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/mathML/importer.py +0 -0
  14. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/mathML/symbol.py +0 -0
  15. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/mathML/test_mathML.py +0 -0
  16. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/mathML/to_symbolite.py +0 -0
  17. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/sbml/__init__.py +0 -0
  18. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/sbml/from_libsbml.py +0 -0
  19. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/sbml/importer.py +0 -0
  20. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/sbml/test_importer.py +0 -0
  21. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/sbml/tests/atol_factor.csv +0 -0
  22. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/sbml/tests/test_sbml_test_suite.py +0 -0
  23. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/io/sbml/types.py +0 -0
  24. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/reactions/compound.py +0 -0
  25. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/reactions/enzymatic.py +0 -0
  26. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/reactions/single.py +0 -0
  27. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/reactions/test_reactions.py +0 -0
  28. {simbio-1.0.0b2 → simbio-1.0.1}/src/simbio/test_core.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simbio
3
- Version: 1.0.0b2
3
+ Version: 1.0.1
4
4
  Summary: A Python-based package for simulation of Chemical Reaction Networks (CRNs).
5
5
  Keywords: mass action,michaelis menten,ode,compartment,reaction,SBML,poincare
6
6
  Author: Hernán E. Grecco, Mauro Silberberg
@@ -12,7 +12,7 @@ Classifier: Topic :: Scientific/Engineering
12
12
  Classifier: Topic :: Software Development :: Libraries
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Operating System :: OS Independent
15
- Requires-Dist: poincare>=1.0.0b3
15
+ Requires-Dist: poincare>=1.0.0
16
16
  Requires-Dist: biomodels ; extra == 'io'
17
17
  Requires-Dist: python-libsbml ; extra == 'io'
18
18
  Requires-Python: >=3.12
@@ -40,111 +40,7 @@ to add functionality for CRNs.
40
40
 
41
41
  ## Usage
42
42
 
43
- To create a system with two species $A$ and $B$
44
- and a reaction converting $2A \\rightarrow B$ with rate 1:
45
-
46
- ```python
47
- >>> from simbio import Compartment, Species, RateLaw, initial
48
- >>> class Model(Compartment):
49
- ... A: Species = initial(default=1)
50
- ... B: Species = initial(default=0)
51
- ... r = RateLaw(
52
- ... reactants=[2 * A],
53
- ... products=[B],
54
- ... rate_law=1,
55
- ... )
56
- ```
57
-
58
- This corresponds to the following system of equations
59
-
60
- $$
61
- \\begin{cases}
62
- \\frac{dA}{dt} = -2 \\
63
- \\frac{dB}{dt} = +1
64
- \\end{cases}
65
- $$
66
-
67
- with initial conditions
68
-
69
- $$
70
- \\begin{cases}
71
- A(0) = 1 \\
72
- B(0) = 0
73
- \\end{cases}
74
- $$
75
-
76
- In CRNs,
77
- we usually deal with [mass-action](https://en.wikipedia.org/wiki/Law_of_mass_action) reactions.
78
- Using `MassAction` instead of `Reaction` automatically adds the reactants to the rate law:
79
-
80
- ```python
81
- >>> from simbio import MassAction
82
- >>> class MassActionModel(Compartment):
83
- ... A: Species = initial(default=1)
84
- ... B: Species = initial(default=0)
85
- ... r = MassAction(
86
- ... reactants=[2 * A],
87
- ... products=[B],
88
- ... rate=1,
89
- ... )
90
- ```
91
-
92
- generating the following equations:
93
-
94
- $$
95
- \\begin{cases}
96
- \\frac{dA}{dt} = -2 A^2 \\
97
- \\frac{dB}{dt} = +1 A^2
98
- \\end{cases}
99
- $$
100
-
101
- To simulate the system,
102
- use the `Simulator.solve` which outputs a `pandas.DataFrame`:
103
-
104
- ```python
105
- >>> from simbio import Simulator
106
- >>> Simulator(MassActionModel).solve(save_at=range(5))
107
- A B
108
- time
109
- 0 1.000000 0.000000
110
- 1 0.333266 0.333367
111
- 2 0.199937 0.400032
112
- 3 0.142798 0.428601
113
- 4 0.111061 0.444470
114
- ```
115
-
116
- For more details into SimBio's capabilities,
117
- we recommend reading [poincaré's README](https://github.com/dyscolab/poincare).
118
-
119
- ## SBML
120
-
121
- SimBio can import models from Systems Biology Markup Language (SBML) files:
122
-
123
- ```python
124
- >>> from simbio.io import sbml
125
- >>> sbml.load("repressilator.sbml")
126
- Elowitz2000 - Repressilator
127
- -----------------------------------------------------------------------------------
128
- type total names
129
- ---------- ------- --------------------------------------------------------------
130
- variables 6 PX, PY, PZ, X, Y, Z
131
- parameters 17 cell, beta, alpha0, alpha, eff, n, KM, tau_mRNA, tau_prot, ...
132
- equations 12 Reaction1, Reaction2, Reaction3, Reaction4, Reaction5, ...
133
- ```
134
-
135
- or download them from the [BioModels](https://www.ebi.ac.uk/biomodels/) repository:
136
-
137
- ```python
138
- >>> from simbio.io import biomodels
139
- >>> biomodels.load("BIOMD12")
140
- Elowitz2000 - Repressilator
141
- -----------------------------------------------------------------------------------
142
- type total names
143
- ---------- ------- --------------------------------------------------------------
144
- variables 6 PX, PY, PZ, X, Y, Z
145
- parameters 17 cell, beta, alpha0, alpha, eff, n, KM, tau_mRNA, tau_prot, ...
146
- equations 12 Reaction1, Reaction2, Reaction3, Reaction4, Reaction5, ...
147
- ```
43
+ See [simbio's documentation](https://dyscolab.github.io/simbio/) on the dyscolab page, or go directly to the [intro tutorial](https://marimo.app/github.com/dyscolab/dyscolab-tutorials/blob/main/simbio/getting_started_with_simbio.py).
148
44
 
149
45
  ## Install
150
46
 
simbio-1.0.1/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # simbio
2
+
3
+ [![Copier Badge][copier-badge]][copier-url]
4
+ [![Pixi Badge][pixi-badge]][pixi-url]
5
+ ![License][license-badge]
6
+ [![CI Badge][ci-badge]][ci-url]
7
+ [![conda-forge Badge][conda-forge-badge]][conda-forge-url]
8
+ [![PyPI Badge][pypi-badge]][pypi-url]
9
+ [![Python version Badge][pypi-version-badge]][pypi-version-url]
10
+
11
+ A Python-based package for simulation of Chemical Reaction Networks (CRNs).
12
+ It extends [`poincare`](https://github.com/dyscolab/poincare),
13
+ a package for modelling dynamical systems,
14
+ to add functionality for CRNs.
15
+
16
+ ## Usage
17
+
18
+ See [simbio's documentation](https://dyscolab.github.io/simbio/) on the dyscolab page, or go directly to the [intro tutorial](https://marimo.app/github.com/dyscolab/dyscolab-tutorials/blob/main/simbio/getting_started_with_simbio.py).
19
+
20
+ ## Install
21
+
22
+ Using [pixi][pixi-url],
23
+ install from PyPI with:
24
+
25
+ ```sh
26
+ pixi add --pypi simbio
27
+ ```
28
+
29
+ or install the latest development version from GitHub with:
30
+
31
+ ```sh
32
+ pixi add --pypi simbio@https://github.com/dyscolab/simbio.git
33
+ ```
34
+
35
+ Otherwise,
36
+ use `pip` or your `pip`-compatible package manager:
37
+
38
+ ```sh
39
+ pip install simbio # from PyPI
40
+ pip install git+https://github.com/dyscolab/simbio.git # from GitHub
41
+ ```
42
+
43
+ ## Development
44
+
45
+ This project is managed by [pixi][pixi-url].
46
+ You can install it for development using:
47
+
48
+ ```sh
49
+ git clone https://github.com/dyscolab/simbio
50
+ cd simbio
51
+ pixi run pre-commit-install
52
+ ```
53
+
54
+ Pre-commit hooks are used to lint and format the project.
55
+
56
+ ### Testing
57
+
58
+ Run tests using:
59
+
60
+ ```sh
61
+ pixi run test
62
+ ```
63
+
64
+ ### Publishing to PyPI
65
+
66
+ When a tagged commit is pushed to GitHub,
67
+ the GitHub Action defined in `.github/workflows/ci.yml`
68
+ builds and publishes the package to PyPI.
69
+
70
+ Tag a commit and push the tags with:
71
+
72
+ ```sh
73
+ git tag <my-tag>
74
+ git push --tags
75
+ ```
76
+
77
+ Trusted publishing must be enabled once in [PyPI Publishing](https://pypi.org/manage/account/publishing/).
78
+ Fill the following values in the form:
79
+
80
+ ```
81
+ PyPI Project Name: simbio
82
+ Owner: maurosilber
83
+ Repository name: simbio
84
+ Workflow name: ci.yml
85
+ Environment name: pypi
86
+ ```
87
+
88
+ [ci-badge]: https://img.shields.io/github/actions/workflow/status/dyscolab/simbio/ci.yml
89
+ [ci-url]: https://github.com/dyscolab/simbio/actions/workflows/ci.yml
90
+ [conda-forge-badge]: https://img.shields.io/conda/vn/conda-forge/simbio?logoColor=white&logo=conda-forge
91
+ [conda-forge-url]: https://prefix.dev/channels/conda-forge/packages/simbio
92
+ [copier-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-black.json
93
+ [copier-url]: https://github.com/copier-org/copier
94
+ [license-badge]: https://img.shields.io/badge/license-MIT-blue
95
+ [pixi-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json
96
+ [pixi-url]: https://pixi.sh
97
+ [pypi-badge]: https://img.shields.io/pypi/v/simbio.svg?logo=pypi&logoColor=white
98
+ [pypi-url]: https://pypi.org/project/simbio
99
+ [pypi-version-badge]: https://img.shields.io/pypi/pyversions/simbio?logoColor=white&logo=python
100
+ [pypi-version-url]: https://pypi.org/project/simbio
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "simbio"
3
3
  description = "A Python-based package for simulation of Chemical Reaction Networks (CRNs)."
4
- version = "1.0.0b2"
4
+ version = "1.0.1"
5
5
  authors = [
6
6
  { name = "Hernán E. Grecco", email = "hernan.grecco@gmail.com" },
7
7
  { name = "Mauro Silberberg", email = "maurosilber@gmail.com" },
@@ -26,7 +26,7 @@ keywords = [
26
26
  "poincare",
27
27
  ]
28
28
  requires-python = ">=3.12"
29
- dependencies = ["poincare >= 1.0.0b3"]
29
+ dependencies = ["poincare >= 1.0.0"]
30
30
 
31
31
  [project.urls]
32
32
  homepage = "https://github.com/dyscolab/simbio"
@@ -74,7 +74,7 @@ backend = { name = "pixi-build-python", version = "0.4.*" }
74
74
  uv-build = "*"
75
75
 
76
76
  [tool.pixi.package.run-dependencies]
77
- # poincare = ">=1.0.0b2"
77
+ # poincare = ">=1.0.0"
78
78
 
79
79
  [tool.pixi.environments]
80
80
  default = ["test", "py312"]
@@ -19,10 +19,12 @@ from .core import (
19
19
  Compartment,
20
20
  Species,
21
21
  System,
22
+ Volume,
22
23
  amount,
23
24
  concentration,
24
25
  reaction_amount,
25
26
  reaction_concentration,
27
+ volume,
26
28
  )
27
29
 
28
30
  __all__ = [
@@ -31,11 +33,13 @@ __all__ = [
31
33
  "assign",
32
34
  ]
33
35
  __all__ += [
36
+ "Simulator",
34
37
  "Compartment",
35
38
  "System",
36
39
  "Variable",
37
40
  "Reactant",
38
41
  "Species",
42
+ "Volume",
39
43
  "Parameter",
40
44
  "MassAction",
41
45
  "RateLaw",
@@ -46,5 +50,5 @@ __all__ += [
46
50
  "reaction_initial",
47
51
  "reaction_concentration",
48
52
  "reaction_amount",
49
- "Simulator",
53
+ "volume",
50
54
  ]
@@ -1,13 +1,13 @@
1
- # from .compound import (
2
- # CatalyzeConvert,
3
- # Equilibration,
4
- # ReversibleSynthesis,
5
- # )
6
- # from .enzymatic import (
7
- # MichaelisMenten,
8
- # MichaelisMentenEqApprox,
9
- # MichaelisMentenQuasiSSAprox,
10
- # )
1
+ from .compound import (
2
+ CatalyzeConvert,
3
+ Equilibration,
4
+ ReversibleSynthesis,
5
+ )
6
+ from .enzymatic import (
7
+ MichaelisMenten,
8
+ MichaelisMentenEqApprox,
9
+ MichaelisMentenQuasiSSAprox,
10
+ )
11
11
  from .single import (
12
12
  AutoCreation,
13
13
  Conversion,
simbio-1.0.0b2/README.md DELETED
@@ -1,204 +0,0 @@
1
- # simbio
2
-
3
- [![Copier Badge][copier-badge]][copier-url]
4
- [![Pixi Badge][pixi-badge]][pixi-url]
5
- ![License][license-badge]
6
- [![CI Badge][ci-badge]][ci-url]
7
- [![conda-forge Badge][conda-forge-badge]][conda-forge-url]
8
- [![PyPI Badge][pypi-badge]][pypi-url]
9
- [![Python version Badge][pypi-version-badge]][pypi-version-url]
10
-
11
- A Python-based package for simulation of Chemical Reaction Networks (CRNs).
12
- It extends [`poincare`](https://github.com/dyscolab/poincare),
13
- a package for modelling dynamical systems,
14
- to add functionality for CRNs.
15
-
16
- ## Usage
17
-
18
- To create a system with two species $A$ and $B$
19
- and a reaction converting $2A \\rightarrow B$ with rate 1:
20
-
21
- ```python
22
- >>> from simbio import Compartment, Species, RateLaw, initial
23
- >>> class Model(Compartment):
24
- ... A: Species = initial(default=1)
25
- ... B: Species = initial(default=0)
26
- ... r = RateLaw(
27
- ... reactants=[2 * A],
28
- ... products=[B],
29
- ... rate_law=1,
30
- ... )
31
- ```
32
-
33
- This corresponds to the following system of equations
34
-
35
- $$
36
- \\begin{cases}
37
- \\frac{dA}{dt} = -2 \\
38
- \\frac{dB}{dt} = +1
39
- \\end{cases}
40
- $$
41
-
42
- with initial conditions
43
-
44
- $$
45
- \\begin{cases}
46
- A(0) = 1 \\
47
- B(0) = 0
48
- \\end{cases}
49
- $$
50
-
51
- In CRNs,
52
- we usually deal with [mass-action](https://en.wikipedia.org/wiki/Law_of_mass_action) reactions.
53
- Using `MassAction` instead of `Reaction` automatically adds the reactants to the rate law:
54
-
55
- ```python
56
- >>> from simbio import MassAction
57
- >>> class MassActionModel(Compartment):
58
- ... A: Species = initial(default=1)
59
- ... B: Species = initial(default=0)
60
- ... r = MassAction(
61
- ... reactants=[2 * A],
62
- ... products=[B],
63
- ... rate=1,
64
- ... )
65
- ```
66
-
67
- generating the following equations:
68
-
69
- $$
70
- \\begin{cases}
71
- \\frac{dA}{dt} = -2 A^2 \\
72
- \\frac{dB}{dt} = +1 A^2
73
- \\end{cases}
74
- $$
75
-
76
- To simulate the system,
77
- use the `Simulator.solve` which outputs a `pandas.DataFrame`:
78
-
79
- ```python
80
- >>> from simbio import Simulator
81
- >>> Simulator(MassActionModel).solve(save_at=range(5))
82
- A B
83
- time
84
- 0 1.000000 0.000000
85
- 1 0.333266 0.333367
86
- 2 0.199937 0.400032
87
- 3 0.142798 0.428601
88
- 4 0.111061 0.444470
89
- ```
90
-
91
- For more details into SimBio's capabilities,
92
- we recommend reading [poincaré's README](https://github.com/dyscolab/poincare).
93
-
94
- ## SBML
95
-
96
- SimBio can import models from Systems Biology Markup Language (SBML) files:
97
-
98
- ```python
99
- >>> from simbio.io import sbml
100
- >>> sbml.load("repressilator.sbml")
101
- Elowitz2000 - Repressilator
102
- -----------------------------------------------------------------------------------
103
- type total names
104
- ---------- ------- --------------------------------------------------------------
105
- variables 6 PX, PY, PZ, X, Y, Z
106
- parameters 17 cell, beta, alpha0, alpha, eff, n, KM, tau_mRNA, tau_prot, ...
107
- equations 12 Reaction1, Reaction2, Reaction3, Reaction4, Reaction5, ...
108
- ```
109
-
110
- or download them from the [BioModels](https://www.ebi.ac.uk/biomodels/) repository:
111
-
112
- ```python
113
- >>> from simbio.io import biomodels
114
- >>> biomodels.load("BIOMD12")
115
- Elowitz2000 - Repressilator
116
- -----------------------------------------------------------------------------------
117
- type total names
118
- ---------- ------- --------------------------------------------------------------
119
- variables 6 PX, PY, PZ, X, Y, Z
120
- parameters 17 cell, beta, alpha0, alpha, eff, n, KM, tau_mRNA, tau_prot, ...
121
- equations 12 Reaction1, Reaction2, Reaction3, Reaction4, Reaction5, ...
122
- ```
123
-
124
- ## Install
125
-
126
- Using [pixi][pixi-url],
127
- install from PyPI with:
128
-
129
- ```sh
130
- pixi add --pypi simbio
131
- ```
132
-
133
- or install the latest development version from GitHub with:
134
-
135
- ```sh
136
- pixi add --pypi simbio@https://github.com/dyscolab/simbio.git
137
- ```
138
-
139
- Otherwise,
140
- use `pip` or your `pip`-compatible package manager:
141
-
142
- ```sh
143
- pip install simbio # from PyPI
144
- pip install git+https://github.com/dyscolab/simbio.git # from GitHub
145
- ```
146
-
147
- ## Development
148
-
149
- This project is managed by [pixi][pixi-url].
150
- You can install it for development using:
151
-
152
- ```sh
153
- git clone https://github.com/dyscolab/simbio
154
- cd simbio
155
- pixi run pre-commit-install
156
- ```
157
-
158
- Pre-commit hooks are used to lint and format the project.
159
-
160
- ### Testing
161
-
162
- Run tests using:
163
-
164
- ```sh
165
- pixi run test
166
- ```
167
-
168
- ### Publishing to PyPI
169
-
170
- When a tagged commit is pushed to GitHub,
171
- the GitHub Action defined in `.github/workflows/ci.yml`
172
- builds and publishes the package to PyPI.
173
-
174
- Tag a commit and push the tags with:
175
-
176
- ```sh
177
- git tag <my-tag>
178
- git push --tags
179
- ```
180
-
181
- Trusted publishing must be enabled once in [PyPI Publishing](https://pypi.org/manage/account/publishing/).
182
- Fill the following values in the form:
183
-
184
- ```
185
- PyPI Project Name: simbio
186
- Owner: maurosilber
187
- Repository name: simbio
188
- Workflow name: ci.yml
189
- Environment name: pypi
190
- ```
191
-
192
- [ci-badge]: https://img.shields.io/github/actions/workflow/status/dyscolab/simbio/ci.yml
193
- [ci-url]: https://github.com/dyscolab/simbio/actions/workflows/ci.yml
194
- [conda-forge-badge]: https://img.shields.io/conda/vn/conda-forge/simbio?logoColor=white&logo=conda-forge
195
- [conda-forge-url]: https://prefix.dev/channels/conda-forge/packages/simbio
196
- [copier-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-black.json
197
- [copier-url]: https://github.com/copier-org/copier
198
- [license-badge]: https://img.shields.io/badge/license-MIT-blue
199
- [pixi-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json
200
- [pixi-url]: https://pixi.sh
201
- [pypi-badge]: https://img.shields.io/pypi/v/simbio.svg?logo=pypi&logoColor=white
202
- [pypi-url]: https://pypi.org/project/simbio
203
- [pypi-version-badge]: https://img.shields.io/pypi/pyversions/simbio?logoColor=white&logo=python
204
- [pypi-version-url]: https://pypi.org/project/simbio
File without changes
File without changes