finitewave-model-courtemanche 0.2.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.
@@ -0,0 +1,207 @@
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
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Finitewave
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,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: finitewave-model-courtemanche
3
+ Version: 0.2.0
4
+ Summary: Courtemanche model.
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Keywords: cardiac,electrophysiology,finitewave,model
8
+ Classifier: Intended Audience :: Science/Research
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+
16
+ ## Courtemanche finitewave model
17
+
18
+ This model describes the ionic currents and action potential dynamics of human atrial myocytes. It includes detailed formulations for major ionic currents (fast sodium current, L-type calcium current, inward rectifier potassium current, transient outward potassium current, rapid and slow delayed rectifier potassium currents, and Na⁺/Ca²⁺ exchanger), as well as calcium handling mechanisms.
19
+
20
+ The Courtemanche model is widely used as a reference atrial electrophysiology model. It has served as the basis for many subsequent atrial modeling studies, including investigations of atrial fibrillation and drug effects.
21
+
22
+ ### Reference
23
+ Courtemanche M, Ramirez RJ, Nattel S. Ionic mechanisms underlying human atrial action potential properties: insights from a mathematical model. Am J Physiol. 1998 Jul;275(1):H301-21.
24
+
25
+ DOI: 10.1152/ajpheart.1998.275.1.H301
26
+
27
+ ### How to use (quickstart)
28
+ ```bash
29
+ python -m examples.courtemanche_example
30
+ ```
31
+
32
+ ### How to test
33
+ ```bash
34
+ python -m pytest -q
35
+ ```
36
+
37
+ ### Repository structure
38
+ ```text
39
+ .
40
+ ├── courtemanche/ # equations package (ops.py)
41
+ │ ├── __init__.py
42
+ │ └── ops.py # model equations (pure functions)
43
+ ├── implementation/ # 0D model implementation
44
+ │ ├── __init__.py
45
+ │ └── courtemanche_0d.py
46
+ ├── example/
47
+ │ └── courtemanche_example.py # minimal script to run a short trace
48
+ ├── tests/
49
+ │ └── test.py # smoke test; reproducibility checks
50
+ ├── .gitignore
51
+ ├── LICENSE # MIT
52
+ ├── pyproject.toml # configuration file
53
+ └── README.md # this file
54
+ ```
55
+
56
+ ### Variables
57
+ - `u = -84.5` - Membrane potential (mV)
58
+ - `nai = 11.2` - intracellular Na⁺ concentration (mM)
59
+ - `ki = 139` - intracellular K⁺ concentration (mM)
60
+ - `cai = 0.000102` - intracellular Ca²⁺ concentration (mM)
61
+ - `caup = 1.6` - Ca²⁺ concentration in uptake compartment (mM)
62
+ - `carel = 1.1` - Ca²⁺ concentration in release compartment (mM)
63
+ - `m = 0.00291 ` - activation gate of fast Na⁺ current
64
+ - `h = 0.965` - fast inactivation gate of I_Na
65
+ - `j = 0.978` - slow inactivation gate of I_Na
66
+ - `d = 0.000137` - activation gate of L-type Ca²⁺ current
67
+ - `f = 0.999837` - inactivation gate of I_CaL
68
+ - `oa = 0.000592` - activation gate of transient outward K⁺ current
69
+ - `oi = 0.9992` - inactivation gate of I_to
70
+ - `ua = 0.003519` - activation gate of ultra-rapid K⁺ current
71
+ - `ui = 0.9987` - inactivation gate of I_Kur
72
+ - `xs = 0.0187` - activation gate of slow delayed rectifier K⁺ current
73
+ - `xr = 0.0000329` - activation gate of rapid delayed rectifier K⁺ current
74
+ - `fca = 0.775` - Ca²⁺-dependent inactivation gate of I_CaL
75
+ - `irel = 0` - Ca²⁺ release current from SR
76
+ - `vrel = 1` - SR release flux variable (voltage-dependent)
77
+ - `urel = 0` - SR release gate variable
78
+ - `wrel = 0.9` - SR recovery variable
79
+
80
+
81
+ ### Parameters
82
+ - `gna = 7.8` - maximum conductance of fast sodium current (mS/cm²)
83
+ - `gnab = 0.000674` - maximum conductance of background sodium current (mS/cm²)
84
+ - `gk1 = 0.09` - maximum conductance of inward rectifier potassium current (mS/cm²)
85
+ - `gkr = 0.0294` - maximum conductance of rapid delayed rectifier potassium current (mS/cm²)
86
+ - `gks = 0.129` - maximum conductance of slow delayed rectifier potassium current (mS/cm²)
87
+ - `gto = 0.1652` - maximum conductance of transient outward potassium current (mS/cm²)
88
+ - `gcal = 0.1238` - maximum conductance of L-type calcium current (mS/cm²)
89
+ - `gcab = 0.00113` - maximum conductance of background calcium current (mS/cm²)
90
+ - `Vc = 20100` - cell volume (µL)
91
+ - `Vj = Vc * 0.68` - junction volume (µL)
92
+ - `Vup = Vj * 0.06 * 0.92` - uptake compartment volume (µL)
93
+ - `Vrel = Vj * 0.06 * 0.08` - release compartment volume (µL)
94
+ - `ibk = 0.0` - background current (µA/cm²)
95
+ - `cao = 1.8` - extracellular Ca²⁺ concentration (mM)
96
+ - `nao = 140` - extracellular Na⁺ concentration (mM)
97
+ - `ko = 5.4` - extracellular K⁺ concentration (mM)
98
+ - `caupmax = 15` - maximum Ca²⁺ uptake rate (mM/ms)
99
+ - `kup = 0.00092` - uptake rate constant (mM)
100
+ - `kmnai = 10` - Michaelis-Menten constant for Na⁺ (mM)
101
+ - `kmko = 1.5` - Michaelis-Menten constant for K⁺ (mM)
102
+ - `kmnancx = 87.5` - Michaelis-Menten constant for Na⁺/Ca²⁺ exchanger (mM)
103
+ - `kmcancx = 1.38` - Michaelis-Menten constant for Ca²⁺/Na⁺ exchanger (mM)
104
+ - `ksatncx = 0.1` - saturation constant for Na⁺/Ca²⁺ exchanger
105
+ - `kmcmdn = 0.00238` - Michaelis-Menten constant for calmodulin (mM)
106
+ - `kmtrpn = 0.0005` - Michaelis-Menten constant for troponin (mM)
107
+ - `kmcsqn = 0.8` - Michaelis-Menten constant for calsequestrin (mM)
108
+ - `trpnmax = 0.07` - maximum troponin concentration (mM)
109
+ - `cmdnmax = 0.05` - maximum calmodulin concentration (mM)
110
+ - `csqnmax = 10.0` - maximum calsequestrin concentration (mM)
111
+ - `inacamax = 1600` - maximum Na⁺ current (µA/cm²)
112
+ - `inakmax = 0.6` - maximum Na⁺/K⁺ pump current (µA/cm²)
113
+ - `ipcamax = 0.275` - maximum Ca²⁺ pump current (µA/cm²)
114
+ - `krel = 30` - release rate constant
115
+ - `iupmax = 0.005` - maximum uptake current (µA/cm²)
116
+ - `kq10 = 3` - temperature sensitivity coefficient
117
+
@@ -0,0 +1,102 @@
1
+ ## Courtemanche finitewave model
2
+
3
+ This model describes the ionic currents and action potential dynamics of human atrial myocytes. It includes detailed formulations for major ionic currents (fast sodium current, L-type calcium current, inward rectifier potassium current, transient outward potassium current, rapid and slow delayed rectifier potassium currents, and Na⁺/Ca²⁺ exchanger), as well as calcium handling mechanisms.
4
+
5
+ The Courtemanche model is widely used as a reference atrial electrophysiology model. It has served as the basis for many subsequent atrial modeling studies, including investigations of atrial fibrillation and drug effects.
6
+
7
+ ### Reference
8
+ Courtemanche M, Ramirez RJ, Nattel S. Ionic mechanisms underlying human atrial action potential properties: insights from a mathematical model. Am J Physiol. 1998 Jul;275(1):H301-21.
9
+
10
+ DOI: 10.1152/ajpheart.1998.275.1.H301
11
+
12
+ ### How to use (quickstart)
13
+ ```bash
14
+ python -m examples.courtemanche_example
15
+ ```
16
+
17
+ ### How to test
18
+ ```bash
19
+ python -m pytest -q
20
+ ```
21
+
22
+ ### Repository structure
23
+ ```text
24
+ .
25
+ ├── courtemanche/ # equations package (ops.py)
26
+ │ ├── __init__.py
27
+ │ └── ops.py # model equations (pure functions)
28
+ ├── implementation/ # 0D model implementation
29
+ │ ├── __init__.py
30
+ │ └── courtemanche_0d.py
31
+ ├── example/
32
+ │ └── courtemanche_example.py # minimal script to run a short trace
33
+ ├── tests/
34
+ │ └── test.py # smoke test; reproducibility checks
35
+ ├── .gitignore
36
+ ├── LICENSE # MIT
37
+ ├── pyproject.toml # configuration file
38
+ └── README.md # this file
39
+ ```
40
+
41
+ ### Variables
42
+ - `u = -84.5` - Membrane potential (mV)
43
+ - `nai = 11.2` - intracellular Na⁺ concentration (mM)
44
+ - `ki = 139` - intracellular K⁺ concentration (mM)
45
+ - `cai = 0.000102` - intracellular Ca²⁺ concentration (mM)
46
+ - `caup = 1.6` - Ca²⁺ concentration in uptake compartment (mM)
47
+ - `carel = 1.1` - Ca²⁺ concentration in release compartment (mM)
48
+ - `m = 0.00291 ` - activation gate of fast Na⁺ current
49
+ - `h = 0.965` - fast inactivation gate of I_Na
50
+ - `j = 0.978` - slow inactivation gate of I_Na
51
+ - `d = 0.000137` - activation gate of L-type Ca²⁺ current
52
+ - `f = 0.999837` - inactivation gate of I_CaL
53
+ - `oa = 0.000592` - activation gate of transient outward K⁺ current
54
+ - `oi = 0.9992` - inactivation gate of I_to
55
+ - `ua = 0.003519` - activation gate of ultra-rapid K⁺ current
56
+ - `ui = 0.9987` - inactivation gate of I_Kur
57
+ - `xs = 0.0187` - activation gate of slow delayed rectifier K⁺ current
58
+ - `xr = 0.0000329` - activation gate of rapid delayed rectifier K⁺ current
59
+ - `fca = 0.775` - Ca²⁺-dependent inactivation gate of I_CaL
60
+ - `irel = 0` - Ca²⁺ release current from SR
61
+ - `vrel = 1` - SR release flux variable (voltage-dependent)
62
+ - `urel = 0` - SR release gate variable
63
+ - `wrel = 0.9` - SR recovery variable
64
+
65
+
66
+ ### Parameters
67
+ - `gna = 7.8` - maximum conductance of fast sodium current (mS/cm²)
68
+ - `gnab = 0.000674` - maximum conductance of background sodium current (mS/cm²)
69
+ - `gk1 = 0.09` - maximum conductance of inward rectifier potassium current (mS/cm²)
70
+ - `gkr = 0.0294` - maximum conductance of rapid delayed rectifier potassium current (mS/cm²)
71
+ - `gks = 0.129` - maximum conductance of slow delayed rectifier potassium current (mS/cm²)
72
+ - `gto = 0.1652` - maximum conductance of transient outward potassium current (mS/cm²)
73
+ - `gcal = 0.1238` - maximum conductance of L-type calcium current (mS/cm²)
74
+ - `gcab = 0.00113` - maximum conductance of background calcium current (mS/cm²)
75
+ - `Vc = 20100` - cell volume (µL)
76
+ - `Vj = Vc * 0.68` - junction volume (µL)
77
+ - `Vup = Vj * 0.06 * 0.92` - uptake compartment volume (µL)
78
+ - `Vrel = Vj * 0.06 * 0.08` - release compartment volume (µL)
79
+ - `ibk = 0.0` - background current (µA/cm²)
80
+ - `cao = 1.8` - extracellular Ca²⁺ concentration (mM)
81
+ - `nao = 140` - extracellular Na⁺ concentration (mM)
82
+ - `ko = 5.4` - extracellular K⁺ concentration (mM)
83
+ - `caupmax = 15` - maximum Ca²⁺ uptake rate (mM/ms)
84
+ - `kup = 0.00092` - uptake rate constant (mM)
85
+ - `kmnai = 10` - Michaelis-Menten constant for Na⁺ (mM)
86
+ - `kmko = 1.5` - Michaelis-Menten constant for K⁺ (mM)
87
+ - `kmnancx = 87.5` - Michaelis-Menten constant for Na⁺/Ca²⁺ exchanger (mM)
88
+ - `kmcancx = 1.38` - Michaelis-Menten constant for Ca²⁺/Na⁺ exchanger (mM)
89
+ - `ksatncx = 0.1` - saturation constant for Na⁺/Ca²⁺ exchanger
90
+ - `kmcmdn = 0.00238` - Michaelis-Menten constant for calmodulin (mM)
91
+ - `kmtrpn = 0.0005` - Michaelis-Menten constant for troponin (mM)
92
+ - `kmcsqn = 0.8` - Michaelis-Menten constant for calsequestrin (mM)
93
+ - `trpnmax = 0.07` - maximum troponin concentration (mM)
94
+ - `cmdnmax = 0.05` - maximum calmodulin concentration (mM)
95
+ - `csqnmax = 10.0` - maximum calsequestrin concentration (mM)
96
+ - `inacamax = 1600` - maximum Na⁺ current (µA/cm²)
97
+ - `inakmax = 0.6` - maximum Na⁺/K⁺ pump current (µA/cm²)
98
+ - `ipcamax = 0.275` - maximum Ca²⁺ pump current (µA/cm²)
99
+ - `krel = 30` - release rate constant
100
+ - `iupmax = 0.005` - maximum uptake current (µA/cm²)
101
+ - `kq10 = 3` - temperature sensitivity coefficient
102
+
@@ -0,0 +1 @@
1
+ from . import ops