Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
248 lines (222 loc) · 7.11 KB
/
Copy pathpyproject.toml
File metadata and controls
248 lines (222 loc) · 7.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
[build-system] # Require setuptool version due to https://github.com/pypa/setuptools/issues/2938
requires = [
"scikit-build-core[pyproject]>=0.11.0", # Ensuring license field is correctly parsed]
"nanobind>=1.3.2",
"setuptools>=77.0.3", # Ensuring license field is correctly parsed]
"packaging>=24.2", # Ensuring license field is correctly parsed]
"pkgconfig",
]
[project]
name = "simcardemsx"
version = "0.2.0"
description = "Next generation cardiac electro-mechanics solver based on FEniCSx"
authors = [{name = "Henrik Finsberg", email = "henriknf@simula.no"}]
license = "MIT"
license-files = ["LICENSE"]
readme = "README.md"
keywords = ["cardiac", "electromechanics", "finite element", "fenicsx", "electrophysiology"]
classifiers = [
"Programming Language :: Python :: 3",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
]
requires-python = ">=3.12.0"
dependencies = [
"fenics-dolfinx",
# pulse 0.11.1 and beat 0.7.2 are the first releases with the restart API that
# simcardemsx.checkpoint calls (restart_functions/restart_metadata, and pulse's
# CycleController.state_dict); SimulationController.step() snapshots through it.
# beat 0.9.0 replaced beat.ecg.Leads12 with twelve_lead(), which rodero_05's post.py uses.
"fenicsx-pulse>=0.11.1",
"fenicsx-beat>=0.9.0",
# crossbridge backs the Ca_i-split activation backend and is imported at
# package import time via simcardemsx.backends. 0.3.3 is the first release whose
# RDQ20MF can take a step longer than its 25 us RU step (gate X2), and 0.3.4 the
# first with get_state/set_state, which the backend's checkpoint saves.
"crossbridge>=0.3.4",
# io4dolfinx writes and reads restart.h5 and results.h5, with its h5py backend (simcardemsx.checkpoint,
# simcardemsx.results), and is imported at package import time.
"io4dolfinx[h5py]",
# scipy is used by simcardemsx.zero_d for the monolithic reference solve
"scipy",
# gotranx 2.2.0 orders the generated states independently of PYTHONHASHSEED, and its
# GRL step linearizes every state, also through intermediates (1.8 advanced v, cai
# and the concentrations by forward Euler).
"gotranx>=2.2.0",
"toml",
"pydantic",
"pydantic_pint",
]
[project.urls]
Homepage = "https://computationalphysiology.github.io/simcardemsx"
Documentation = "https://computationalphysiology.github.io/simcardemsx"
Source = "https://github.com/ComputationalPhysiology/simcardemsx"
Issues = "https://github.com/ComputationalPhysiology/simcardemsx/issues"
[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
"cardiac-geometriesx",
# Regazzoni's closed-loop circuit (its .ode file), for the circulation gates
"circulation>=0.4.0",
# The 0D reference of tests/test_zero_mech_reference.py: 0.3.0 is the first with
# StretchActiveStress and Holzapfel-Ogden's b = 0 limit (pulse's transversely
# isotropic parameters)
"zero-mech>=0.3.0",
]
dev = [
"pdbpp",
"ipython",
"bump2version",
"mypy",
# Stubs for mypy, which pre-commit runs from this environment (language: system).
# Not scipy-stubs: see the scipy mypy override below.
"types-toml",
"pre-commit",
]
demo = [
"matplotlib",
"cardiac-geometriesx",
"fenicsx-ldrb",
"ukb-atlas",
"circulation>=0.4.0",
"gotranx",
"io4dolfinx[h5py]",
]
docs = [
# MyST builds the site (docs/myst.yml); jupytext turns the tutorials into the notebooks
# it executes, in the kernel ipykernel registers; griffe reads the docstrings for the
# API reference (docs/generate_api_pages.py) without importing the package.
"mystmd",
"jupytext",
"ipykernel",
"jupyter-server",
"griffe>=2",
# Tutorial 5's independent 0D reference
"zero-mech>=0.3.0",
"simcardemsx[demo]",
]
benchmark = [
"pytest-codspeed",
"simcardemsx[test]",
]
all = [
"simcardemsx[test]",
"simcardemsx[docs]",
"simcardemsx[dev]",
"simcardemsx[demo]",
]
[dependency-groups]
# Keep in sync with [build-system].requires above. Needed as a group, not just
# as build-system metadata, because scifem is installed with
# `--no-build-isolation`, so the build backend has to already be present.
build = [
"scikit-build-core[pyproject]>=0.11.0",
"nanobind>=1.3.2",
"setuptools>=77.0.3",
"packaging>=24.2",
"pkgconfig",
]
[tool.pytest.ini_options]
addopts = [
"--cov=simcardemsx",
"--cov-report=html",
"--cov-report=xml",
"--cov-report=term-missing",
"-v",
]
testpaths = [
"tests"
]
markers = ["slow: takes more than a few seconds"]
[[tool.mypy.overrides]]
# scipy ships no types of its own. scipy-stubs would supply them, but it installs optype, and
# pint >= 0.26 imports optype when it is present, which sends mypy <= 2.3.1 into infinite
# recursion (python/mypy#21985; fixed on mypy master by python/mypy#22036, not yet released).
module = ["scipy", "scipy.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# circulation (Regazzoni's circuit, for the circulation gates) ships no py.typed marker.
module = ["circulation", "circulation.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# sympy and zero-mech (the 0D reference of tests/test_zero_mech_reference.py) ship no py.typed
# marker.
module = ["sympy", "sympy.*", "zero_mech", "zero_mech.*"]
ignore_missing_imports = true
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"third-party",
]
# Same as Black.
line-length = 100
# Allow unused variables when underscore-prefixed.
# Assume Python 3.10.
target-version = "py312"
[tool.ruff.lint]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = ["E", "F", "I"]
ignore = ["E402", "E741", "E743", "E731"]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "I"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.lint.isort]
known-first-party = ["cardiac_geometries"]
known-third-party = [
"basix",
"dolfinx",
"ffcx",
"ufl",
"gmsh",
"numpy",
"pytest",
]
section-order = [
"future",
"standard-library",
"mpi",
"third-party",
"first-party",
"local-folder",
]
[tool.ruff.lint.isort.sections]
"mpi" = ["mpi4py", "petsc4py"]
[tool.bumpversion]
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"
tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
current_version = "0.2.0"
[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'