mgrowthctrl 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 (116) hide show
  1. mgrowthctrl-0.1.0/.flake8 +24 -0
  2. mgrowthctrl-0.1.0/.gitignore +228 -0
  3. mgrowthctrl-0.1.0/.gitlab-ci.yml +30 -0
  4. mgrowthctrl-0.1.0/.python_tools.json +5 -0
  5. mgrowthctrl-0.1.0/.readthedocs.yaml +20 -0
  6. mgrowthctrl-0.1.0/LICENSE +21 -0
  7. mgrowthctrl-0.1.0/PKG-INFO +116 -0
  8. mgrowthctrl-0.1.0/README.md +70 -0
  9. mgrowthctrl-0.1.0/TODO.md +11 -0
  10. mgrowthctrl-0.1.0/_project.vim +4 -0
  11. mgrowthctrl-0.1.0/docs/__init__.py +1 -0
  12. mgrowthctrl-0.1.0/docs/_static/.gitkeep +0 -0
  13. mgrowthctrl-0.1.0/docs/_static/base_class_simple_example.png +0 -0
  14. mgrowthctrl-0.1.0/docs/_static/basic_closed_loop_control_inputs.png +0 -0
  15. mgrowthctrl-0.1.0/docs/_static/basic_closed_loop_result.png +0 -0
  16. mgrowthctrl-0.1.0/docs/_static/basic_open_loop_control_inputs.png +0 -0
  17. mgrowthctrl-0.1.0/docs/_static/basic_open_loop_result.png +0 -0
  18. mgrowthctrl-0.1.0/docs/_static/closed_loop_control_inputs.png +0 -0
  19. mgrowthctrl-0.1.0/docs/_static/closed_loop_result.png +0 -0
  20. mgrowthctrl-0.1.0/docs/_static/crm_mcmc_example.png +0 -0
  21. mgrowthctrl-0.1.0/docs/_static/crm_simple_example.png +0 -0
  22. mgrowthctrl-0.1.0/docs/_static/css/customizations.css +7 -0
  23. mgrowthctrl-0.1.0/docs/_static/example_plot.png +0 -0
  24. mgrowthctrl-0.1.0/docs/_static/example_plot_adjusted_rates.png +0 -0
  25. mgrowthctrl-0.1.0/docs/_static/mcmc_error.png +0 -0
  26. mgrowthctrl-0.1.0/docs/_static/open_loop_control_inputs.png +0 -0
  27. mgrowthctrl-0.1.0/docs/_static/open_loop_result.png +0 -0
  28. mgrowthctrl-0.1.0/docs/_static/param_dist.png +0 -0
  29. mgrowthctrl-0.1.0/docs/_templates/autosummary/class.rst +33 -0
  30. mgrowthctrl-0.1.0/docs/_templates/autosummary/function.rst +5 -0
  31. mgrowthctrl-0.1.0/docs/_templates/autosummary/module.rst +6 -0
  32. mgrowthctrl-0.1.0/docs/conf.py +48 -0
  33. mgrowthctrl-0.1.0/docs/control/base.rst +14 -0
  34. mgrowthctrl-0.1.0/docs/control/closed_loop.rst +145 -0
  35. mgrowthctrl-0.1.0/docs/control/introduction.rst +71 -0
  36. mgrowthctrl-0.1.0/docs/control/open_loop.rst +142 -0
  37. mgrowthctrl-0.1.0/docs/fitting/lsq.rst +66 -0
  38. mgrowthctrl-0.1.0/docs/fitting/mcmc.rst +138 -0
  39. mgrowthctrl-0.1.0/docs/index.rst +91 -0
  40. mgrowthctrl-0.1.0/docs/intro/get_started.rst +132 -0
  41. mgrowthctrl-0.1.0/docs/intro/installation.rst +55 -0
  42. mgrowthctrl-0.1.0/docs/models/base_model.rst +110 -0
  43. mgrowthctrl-0.1.0/docs/models/consumer_resource_model.rst +132 -0
  44. mgrowthctrl-0.1.0/docs/requirements.txt +13 -0
  45. mgrowthctrl-0.1.0/docs/tutorials/advanced_closed_loop_control_fitting.rst +215 -0
  46. mgrowthctrl-0.1.0/docs/tutorials/advanced_open_loop_control_fitting.rst +212 -0
  47. mgrowthctrl-0.1.0/docs/tutorials/simple_crm.rst +135 -0
  48. mgrowthctrl-0.1.0/docs/utilities/data_loader.rst +104 -0
  49. mgrowthctrl-0.1.0/docs/utilities/saving.rst +12 -0
  50. mgrowthctrl-0.1.0/docs/utilities/visualization.rst +47 -0
  51. mgrowthctrl-0.1.0/example_plot_metabolites.png +0 -0
  52. mgrowthctrl-0.1.0/example_plot_species.png +0 -0
  53. mgrowthctrl-0.1.0/examples/datasets/BT_WC_export.csv +15 -0
  54. mgrowthctrl-0.1.0/examples/datasets/BT_WC_export_average.csv +15 -0
  55. mgrowthctrl-0.1.0/examples/datasets/Control.csv +64 -0
  56. mgrowthctrl-0.1.0/examples/datasets/No_perturbations_6species.csv +166 -0
  57. mgrowthctrl-0.1.0/examples/datasets/SMGDB00000011/README.md +10 -0
  58. mgrowthctrl-0.1.0/examples/datasets/SMGDB00000011/no_perturbations.csv +34 -0
  59. mgrowthctrl-0.1.0/examples/datasets/bhbtri_3species.csv +120 -0
  60. mgrowthctrl-0.1.0/examples/results/single_species_fits/01_lsq_fit_metabolites.png +0 -0
  61. mgrowthctrl-0.1.0/examples/results/single_species_fits/01_lsq_fit_species.png +0 -0
  62. mgrowthctrl-0.1.0/examples/results/single_species_fits/02_mcmc_error.png +0 -0
  63. mgrowthctrl-0.1.0/examples/results/single_species_fits/03_param_dist.png +0 -0
  64. mgrowthctrl-0.1.0/examples/results/single_species_fits/04_final_mcmc_fit_metabolites.png +0 -0
  65. mgrowthctrl-0.1.0/examples/results/single_species_fits/04_final_mcmc_fit_species.png +0 -0
  66. mgrowthctrl-0.1.0/examples/results/single_species_fits/single_species_trajectory.csv +401 -0
  67. mgrowthctrl-0.1.0/examples/results/six_species_fits/00_initial_simulation_metabolites.png +0 -0
  68. mgrowthctrl-0.1.0/examples/results/six_species_fits/00_initial_simulation_species.png +0 -0
  69. mgrowthctrl-0.1.0/examples/results/six_species_fits/01_lsq_fit_metabolites.png +0 -0
  70. mgrowthctrl-0.1.0/examples/results/six_species_fits/6_species_trajectory.csv +501 -0
  71. mgrowthctrl-0.1.0/examples/results/six_species_fits_with_metabolites/00_initial_simulation_metabolites.png +0 -0
  72. mgrowthctrl-0.1.0/examples/results/six_species_fits_with_metabolites/00_initial_simulation_species.png +0 -0
  73. mgrowthctrl-0.1.0/examples/results/six_species_fits_with_metabolites/01_lsq_fit_metabolites.png +0 -0
  74. mgrowthctrl-0.1.0/examples/results/six_species_fits_with_metabolites/01_lsq_fit_species.png +0 -0
  75. mgrowthctrl-0.1.0/examples/results/six_species_fits_with_metabolites/6_species_trajectory.csv +501 -0
  76. mgrowthctrl-0.1.0/examples/results/three_species_fits/01_lsq_fit_metabolites.png +0 -0
  77. mgrowthctrl-0.1.0/examples/results/three_species_fits/01_lsq_fit_species.png +0 -0
  78. mgrowthctrl-0.1.0/examples/results/three_species_fits/3_species_trajectory.csv +401 -0
  79. mgrowthctrl-0.1.0/examples/results/three_species_fits_chemostat/00_initial_simulation_metabolites.png +0 -0
  80. mgrowthctrl-0.1.0/examples/results/three_species_fits_chemostat/00_initial_simulation_species.png +0 -0
  81. mgrowthctrl-0.1.0/examples/results/three_species_fits_chemostat/01_lsq_fit_metabolites.png +0 -0
  82. mgrowthctrl-0.1.0/examples/results/three_species_fits_chemostat/01_lsq_fit_species.png +0 -0
  83. mgrowthctrl-0.1.0/examples/results/three_species_fits_chemostat/3_species_chemostat_trajectory.csv +201 -0
  84. mgrowthctrl-0.1.0/examples/run_fitting_3species_batch.ipynb +554 -0
  85. mgrowthctrl-0.1.0/examples/run_fitting_3species_chemostat.ipynb +640 -0
  86. mgrowthctrl-0.1.0/examples/run_fitting_6species_chemostat.ipynb +605 -0
  87. mgrowthctrl-0.1.0/examples/run_fitting_6species_chemostat_with_metabolites.ipynb +1123 -0
  88. mgrowthctrl-0.1.0/examples/run_fitting_single.ipynb +457 -0
  89. mgrowthctrl-0.1.0/plot_test.py +52 -0
  90. mgrowthctrl-0.1.0/pyproject.toml +51 -0
  91. mgrowthctrl-0.1.0/run_plot_example.py +64 -0
  92. mgrowthctrl-0.1.0/saved_data.csv +201 -0
  93. mgrowthctrl-0.1.0/scripts/build-docs +4 -0
  94. mgrowthctrl-0.1.0/scripts/extract_doc_examples.py +45 -0
  95. mgrowthctrl-0.1.0/src/mgrowthctrl/__init__.py +0 -0
  96. mgrowthctrl-0.1.0/src/mgrowthctrl/backends/__init__.py +8 -0
  97. mgrowthctrl-0.1.0/src/mgrowthctrl/backends/array.py +148 -0
  98. mgrowthctrl-0.1.0/src/mgrowthctrl/controllers/__init__.py +9 -0
  99. mgrowthctrl-0.1.0/src/mgrowthctrl/controllers/base.py +293 -0
  100. mgrowthctrl-0.1.0/src/mgrowthctrl/controllers/closed_loop.py +208 -0
  101. mgrowthctrl-0.1.0/src/mgrowthctrl/controllers/open_loop.py +174 -0
  102. mgrowthctrl-0.1.0/src/mgrowthctrl/models/__init__.py +2 -0
  103. mgrowthctrl-0.1.0/src/mgrowthctrl/models/base.py +354 -0
  104. mgrowthctrl-0.1.0/src/mgrowthctrl/models/crm/fit.py +544 -0
  105. mgrowthctrl-0.1.0/src/mgrowthctrl/models/crm/model.py +555 -0
  106. mgrowthctrl-0.1.0/src/mgrowthctrl/models/crm/utils.py +539 -0
  107. mgrowthctrl-0.1.0/src/mgrowthctrl/utils/__init__.py +0 -0
  108. mgrowthctrl-0.1.0/src/mgrowthctrl/utils/data.py +549 -0
  109. mgrowthctrl-0.1.0/src/mgrowthctrl/utils/plot.py +417 -0
  110. mgrowthctrl-0.1.0/src/mgrowthctrl/utils/save.py +71 -0
  111. mgrowthctrl-0.1.0/tags +538 -0
  112. mgrowthctrl-0.1.0/tests/conftest.py +59 -0
  113. mgrowthctrl-0.1.0/tests/test_base_controller.py +146 -0
  114. mgrowthctrl-0.1.0/tests/test_dataloader.py +269 -0
  115. mgrowthctrl-0.1.0/tests/test_models.py +89 -0
  116. mgrowthctrl-0.1.0/tmp.csv +15 -0
@@ -0,0 +1,24 @@
1
+ # vim: ft=dosini
2
+
3
+ [flake8]
4
+ extend-ignore =
5
+ # Ignore method complexity
6
+ C901,
7
+ # Don't care about extra whitespace
8
+ E203,
9
+ # Ignore block comment leading #s
10
+ E266,
11
+ # Don't care about module-level import location
12
+ E402,
13
+ # Line too long: sometimes, it can't be avoided
14
+ E501,
15
+ # Multiple statements on one line: more compact
16
+ E701,
17
+ # Do not use a lambda: it's clearer in some contexts
18
+ E731
19
+ exclude =
20
+ .git,
21
+ .micromamba,
22
+ __pycache__,
23
+ docs
24
+ max-complexity = 10
@@ -0,0 +1,228 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+
204
+ # Ruff stuff:
205
+ .ruff_cache/
206
+
207
+ # PyPI configuration file
208
+ .pypirc
209
+
210
+ # Marimo
211
+ marimo/_static/
212
+ marimo/_lsp/
213
+ __marimo__/
214
+
215
+ # Streamlit
216
+ .streamlit/secrets.toml
217
+
218
+ # UV
219
+ uv.lock
220
+
221
+ # VS Code
222
+ .vscode/
223
+
224
+ # macOS
225
+ .DS_Store
226
+
227
+ # Generated code:
228
+ scripts/doc_examples/*
@@ -0,0 +1,30 @@
1
+ # References:
2
+ # - UV setup: https://docs.astral.sh/uv/guides/integration/gitlab/#using-the-uv-image
3
+
4
+ stages:
5
+ - build_and_test
6
+
7
+ variables:
8
+ UV_CACHE_DIR: .uv-cache
9
+ UV_VERSION: "0.11.6"
10
+ PYTHON_VERSION: "3.12"
11
+ BASE_LAYER: trixie-slim
12
+ # GitLab CI creates a separate mountpoint for the build directory,
13
+ # so we need to copy instead of using hard links.
14
+ UV_LINK_MODE: copy
15
+
16
+ build_and_run_tests:
17
+ stage: build_and_test
18
+ image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
19
+ cache:
20
+ - key:
21
+ files: [uv.lock]
22
+ paths:
23
+ - $UV_CACHE_DIR
24
+
25
+ script:
26
+ - uv sync
27
+ - uv run pytest tests/
28
+
29
+ after_script:
30
+ - uv cache prune --ci
@@ -0,0 +1,5 @@
1
+ {
2
+ "paths": [
3
+ "src"
4
+ ]
5
+ }
@@ -0,0 +1,20 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ version: 2
6
+ build:
7
+ os: ubuntu-22.04
8
+ tools:
9
+ python: "3.12"
10
+
11
+ # Build documentation in the "docs/" directory with Sphinx
12
+ sphinx:
13
+ configuration: docs/conf.py
14
+
15
+ # Optional but recommended, declare the Python requirements required
16
+ # to build your documentation
17
+ # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
18
+ python:
19
+ install:
20
+ - requirements: docs/requirements.txt
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Jiawei Li, Thomas Asikis, Ioannis Fragkos, and Lucas Boettcher
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: mgrowthctrl
3
+ Version: 0.1.0
4
+ Summary: mgrowthctrl is a software package for modeling, visualization, and control of microbiome growth dynamics. It provides tools to simulate microbial community dynamics, fit predictive models to experimental data, and steer community composition using control and optimization methods.
5
+ Project-URL: Homepage, https://gitlab.com/ComputationalScience/mgrowthctrl
6
+ Project-URL: Documentation, https://mgrowthctrl.readthedocs.io/en/latest/
7
+ Project-URL: Issues, https://gitlab.com/ComputationalScience/mgrowthctrl/-/issues
8
+ Author-email: Indrah Thelaganathan <indrah2003@gmail.com>, Andrew Radev <andrey.radev@gmail.com>, Jiawei Li <pushup-prong-ashen@duck.com>, Lucas Boettcher <l.boettcher@fs.de>
9
+ License: MIT License
10
+
11
+ Copyright (c) 2021 Jiawei Li, Thomas Asikis, Ioannis Fragkos, and Lucas Boettcher
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: dynamic control,growth dynamics,machine learning,microbiome,neural networks
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Operating System :: OS Independent
34
+ Classifier: Programming Language :: Python :: 3
35
+ Requires-Python: >=3.10
36
+ Requires-Dist: matplotlib>=3.7.1
37
+ Requires-Dist: numpy<2.0,>=1.26
38
+ Requires-Dist: pandas>=2.0
39
+ Requires-Dist: pymcmcstat>=1.9.0
40
+ Requires-Dist: requests>=2.31.0
41
+ Requires-Dist: scipy>=1.10
42
+ Requires-Dist: tensorboard>=2.12
43
+ Requires-Dist: torch>=2.5
44
+ Requires-Dist: torchdiffeq>=0.2.2
45
+ Description-Content-Type: text/markdown
46
+
47
+ ![Latest release](https://gitlab.com/ComputationalScience/mgrowthctrl/-/badges/release.svg)
48
+ ![Tests](https://gitlab.com/ComputationalScience/mgrowthctrl/badges/main/pipeline.svg?key_text=Tests)
49
+
50
+ # mgrowthctrl
51
+
52
+ A Python package for parameter inference, mechanistic microbiome modeling, and control, based on a consumer–resource model (CRM).
53
+
54
+ Detailed documentation is available at [Documentation](https://mgrowthctrl.readthedocs.io/en/latest/).
55
+
56
+ Key features of mgrowthctrl include:
57
+
58
+ - An API for defining and simulating ODE-based microbiome dynamics.
59
+ - A data loader that allows users to retrieve data from [mGrowthDB](https://mgrowthdb.gbiomed.kuleuven.be).
60
+ - A parameter estimation backend offering both least-squares and Markov Chain Monte Carlo (MCMC) optimization.
61
+ - Built-in visualization utilities for evaluating trajectories and analyzing posteriors.
62
+ - A controller framework based on neural ODEs.
63
+ - A modular architecture designed to facilitate the extension and integration of custom models, controllers, and data processing workflows.
64
+
65
+ ## Features
66
+
67
+ ### Models
68
+ - An implementation of a CRM (`CRModel`).
69
+ - Scalable design supporting both single-species and multi-species systems.
70
+ - A unified engine (`BaseODEModel`) with NumPy and PyTorch backends.
71
+ - Extensible base classes enabling straightforward implementation of custom ODE models.
72
+
73
+ ### Controllers
74
+ - `BaseController` provides an abstract interface with `simulate` and `fit` methods.
75
+ - `OpenLoopNeuralController` implements time-dependent control functions.
76
+ - `ClosedLoopNeuralController` implements state-dependent control functions.
77
+
78
+
79
+ ### Fitting Backend
80
+ - Least-squares parameter optimization (`crm_fit_mechanistic`).
81
+ - Bayesian parameter inference through MCMC sampling (`crm_fit_mcmc`).
82
+
83
+ ### Plotting
84
+ - Tools for visualizing coupled metabolite and species population dynamics.
85
+ - Plots of empirical data, spline interpolations, and simulated trajectories.
86
+ - Integration of MCMC outputs to show credible intervals.
87
+
88
+ ## Code Structure
89
+
90
+ ```graphql
91
+ src/mgrowthctrl/
92
+ │
93
+ ├── backends/
94
+ │ ├── array.py # Array backend interfaces for NumPy and PyTorch
95
+ │ └── __init__.py
96
+ │
97
+ ├── controllers/
98
+ │ ├── base.py # BaseController interface with simulate and fit methods
99
+ │ ├── closed_loop.py # ClosedLoopNeuralController
100
+ │ └── open_loop.py # OpenLoopNeuralController
101
+ │
102
+ ├── models/
103
+ │ ├── base.py # ODE base class (uses dependency injection)
104
+ │ └── crm/
105
+ │ ├── fit.py # LSQ + MCMC fitting engine
106
+ │ ├── model.py # Mechanistic CRM using BaseODEModel
107
+ │ └── utils.py # Shared utilities
108
+ │
109
+ ├── utils/
110
+ │ ├── data.py # Data loading functions with a public DataLoader-style API
111
+ │ ├── plot.py # Plotting utilities
112
+ │ ├── save.py # Saving / loading utilities
113
+ │ └── __init__.py
114
+ │
115
+ └── __init__.py
116
+ ```
@@ -0,0 +1,70 @@
1
+ ![Latest release](https://gitlab.com/ComputationalScience/mgrowthctrl/-/badges/release.svg)
2
+ ![Tests](https://gitlab.com/ComputationalScience/mgrowthctrl/badges/main/pipeline.svg?key_text=Tests)
3
+
4
+ # mgrowthctrl
5
+
6
+ A Python package for parameter inference, mechanistic microbiome modeling, and control, based on a consumer–resource model (CRM).
7
+
8
+ Detailed documentation is available at [Documentation](https://mgrowthctrl.readthedocs.io/en/latest/).
9
+
10
+ Key features of mgrowthctrl include:
11
+
12
+ - An API for defining and simulating ODE-based microbiome dynamics.
13
+ - A data loader that allows users to retrieve data from [mGrowthDB](https://mgrowthdb.gbiomed.kuleuven.be).
14
+ - A parameter estimation backend offering both least-squares and Markov Chain Monte Carlo (MCMC) optimization.
15
+ - Built-in visualization utilities for evaluating trajectories and analyzing posteriors.
16
+ - A controller framework based on neural ODEs.
17
+ - A modular architecture designed to facilitate the extension and integration of custom models, controllers, and data processing workflows.
18
+
19
+ ## Features
20
+
21
+ ### Models
22
+ - An implementation of a CRM (`CRModel`).
23
+ - Scalable design supporting both single-species and multi-species systems.
24
+ - A unified engine (`BaseODEModel`) with NumPy and PyTorch backends.
25
+ - Extensible base classes enabling straightforward implementation of custom ODE models.
26
+
27
+ ### Controllers
28
+ - `BaseController` provides an abstract interface with `simulate` and `fit` methods.
29
+ - `OpenLoopNeuralController` implements time-dependent control functions.
30
+ - `ClosedLoopNeuralController` implements state-dependent control functions.
31
+
32
+
33
+ ### Fitting Backend
34
+ - Least-squares parameter optimization (`crm_fit_mechanistic`).
35
+ - Bayesian parameter inference through MCMC sampling (`crm_fit_mcmc`).
36
+
37
+ ### Plotting
38
+ - Tools for visualizing coupled metabolite and species population dynamics.
39
+ - Plots of empirical data, spline interpolations, and simulated trajectories.
40
+ - Integration of MCMC outputs to show credible intervals.
41
+
42
+ ## Code Structure
43
+
44
+ ```graphql
45
+ src/mgrowthctrl/
46
+ │
47
+ ├── backends/
48
+ │ ├── array.py # Array backend interfaces for NumPy and PyTorch
49
+ │ └── __init__.py
50
+ │
51
+ ├── controllers/
52
+ │ ├── base.py # BaseController interface with simulate and fit methods
53
+ │ ├── closed_loop.py # ClosedLoopNeuralController
54
+ │ └── open_loop.py # OpenLoopNeuralController
55
+ │
56
+ ├── models/
57
+ │ ├── base.py # ODE base class (uses dependency injection)
58
+ │ └── crm/
59
+ │ ├── fit.py # LSQ + MCMC fitting engine
60
+ │ ├── model.py # Mechanistic CRM using BaseODEModel
61
+ │ └── utils.py # Shared utilities
62
+ │
63
+ ├── utils/
64
+ │ ├── data.py # Data loading functions with a public DataLoader-style API
65
+ │ ├── plot.py # Plotting utilities
66
+ │ ├── save.py # Saving / loading utilities
67
+ │ └── __init__.py
68
+ │
69
+ └── __init__.py
70
+ ```
@@ -0,0 +1,11 @@
1
+ - [x] Review merge requests
2
+ - [x] Add uncontrolled dynamics
3
+ - [x] Rename to ConsumerResourceModel
4
+ - [ ] Make sure the measurement unit is consistant during data extraction
5
+ - [ ] Rename fit_least_squares
6
+ - [ ] Investigate names.X, and names.Y and whether we should get rid of it
7
+ - [ ] Replace torchbackend to numpy in documentation
8
+ - [ ] Fix which module should be exported
9
+ - [ ] Plot consistantly in documentation and notebook
10
+ - [ ] Make sure metadata (S/X) is supplied when load csv
11
+ - [ ] Generate docstrings
@@ -0,0 +1,4 @@
1
+ runtime projects/python.vim
2
+
3
+ silent AckIgnore scripts/doc_examples examples/.ipynb_checkpoints
4
+ silent TagsExclude docs/** scripts/doc_examples/** examples/.ipynb_checkpoints/**
@@ -0,0 +1 @@
1
+ __version__ = "0.2.0.post1"
File without changes
@@ -0,0 +1,7 @@
1
+ /* Remove too-large margin from multiline function signature lists */
2
+ .rst-content .sig-object dl {
3
+ margin-bottom: 0;
4
+ dd {
5
+ margin-bottom: 0;
6
+ }
7
+ }
@@ -0,0 +1,33 @@
1
+ {{ fullname | escape | underline}}
2
+
3
+ .. currentmodule:: {{ module }}
4
+
5
+ .. autoclass:: {{ objname }}
6
+ :members:
7
+ :undoc-members:
8
+ :show-inheritance:
9
+
10
+ {% block methods %}
11
+ {% if methods %}
12
+ .. rubric:: Methods
13
+
14
+ .. autosummary::
15
+ :nosignatures:
16
+
17
+ {% for item in methods %}
18
+ ~{{ name }}.{{ item }}
19
+ {%- endfor %}
20
+ {% endif %}
21
+ {% endblock %}
22
+
23
+ {% block attributes %}
24
+ {% if attributes %}
25
+ .. rubric:: Attributes
26
+
27
+ .. autosummary::
28
+
29
+ {% for item in attributes %}
30
+ ~{{ name }}.{{ item }}
31
+ {%- endfor %}
32
+ {% endif %}
33
+ {% endblock %}
@@ -0,0 +1,5 @@
1
+ {{ fullname | escape | underline}}
2
+
3
+ .. currentmodule:: {{ module }}
4
+
5
+ .. autofunction:: {{ objname }}
@@ -0,0 +1,6 @@
1
+ {{ fullname | escape | underline}}
2
+
3
+ .. automodule:: {{ fullname }}
4
+ :members:
5
+ :undoc-members:
6
+ :show-inheritance: