-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
249 lines (234 loc) · 5.84 KB
/
pyproject.toml
File metadata and controls
249 lines (234 loc) · 5.84 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
249
[build-system]
requires = ["scikit-build-core>=0.10", "nanobind>=2.7"]
build-backend = "scikit_build_core.build"
[project]
name = "mach-beamform"
version = "0.1.0" # Update via bump-my-version, not manually
description = "Ultrafast GPU-accelerated beamforming kernel for ultrasound imaging"
authors = [
{ name = "Charles Guan" },
{ name = "Gianmarco Pinton" },
{ name = "Alex Rockhill" },
]
maintainers = [
{ name = "Charles Guan" },
{ name = "Gustavo Zago Canal" },
]
readme = "README.md"
keywords = ['beamforming', 'delay and sum', 'ultrasound', 'python', 'cuda']
requires-python = ">=3.10,<3.14"
classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"array-api-compat>=1.11.0",
"einops>=0.8.0",
"jaxtyping>=0.2.36",
# TODO: remove numpy dependency once jaxtyping no longer implicitly depends on numpy
# https://github.com/patrick-kidger/jaxtyping/issues/360
"numpy>=1.25.0",
]
[project.urls]
Repository = "https://github.com/Forest-Neurotech/mach"
[project.optional-dependencies]
uff = [
"pyuff_ustb>=0.1.0",
"scipy>=1.13.1",
"numpy>=1.25.0",
]
vis = [
"matplotlib>=3.9.4",
"colorcet>=3.1.0",
]
examples = [
"pymust>=0.1.8",
"requests>=2.25.0",
"mach-beamform[vis]",
]
all = [
"tqdm>=4.65.0",
"cupy-cuda12x>=12.0.0", # for GPU-compounding. TODO: remove this dependency in the future
"mach-beamform[uff,vis,examples]",
]
[dependency-groups]
dev = [
"bump-my-version>=1.0.0",
"deptry>=0.22.0",
"pre-commit>=2.20.0",
"ruff>=0.9.2",
"ty>=0.0.1a14",
]
test = [
"array-api-strict>=2.0.0",
"beartype>=0.21.0",
"h5py>=3.12.1",
"matplotlib>=3.9.4",
"numpy>=2.0.2",
"pytest>=7.0.0",
"pytest-benchmark[histogram]>=4.0.0",
"pytest-cov>=3.0.0",
"pyuff_ustb>=0.1.0",
"scipy>=1.13.1",
"silx>=2.2.2",
"tqdm>=4.65.0",
"xarray[io]>=2023.1.0",
]
profile = [
"pyinstrument>=5.0.0",
{include-group = "test"}
]
build = [
"scikit-build-core>=0.10",
"nanobind>=2.7",
"cmake >=3.26.4",
"ninja >=1.11.1",
]
array = [
"numpy>=2.0.2",
"cupy-cuda12x>=12.0.0",
"jax[cuda12]>=0.4.30",
]
# Compare with other beamforming libraries
compare = [
"pymust>=0.1.8",
# vbeam and its dependencies
"vbeam>=1.0.10",
"jax[cuda12]>=0.4.30",
"spekk>=1.0.9",
# plotting
"colorcet>=3.1.0",
"seaborn>=0.13.2",
"matplotlib>=3.9.4",
"pandas>=2.1.0",
# moving data to GPU
"cupy-cuda12x>=12.0.0",
]
docs = [
"ipykernel>=6.10",
"matplotlib>=3.9.4",
"myst-parser>=3.0.1",
"numpydoc>=1.5.0",
"numpy>=2.0.2",
"sphinx>=7.2.6",
"sphinx-book-theme>=1.1.3",
"sphinx-gallery>=0.18.0",
]
[tool.uv]
default-groups = "all"
[tool.deptry]
known_first_party = [
"mach",
]
extend_exclude = [
"docs"
]
[tool.deptry.package_module_name_map]
array-api-compat = "array_api_compat"
[tool.scikit-build]
minimum-version = "build-system.requires"
build-dir = "build/{wheel_tag}"
# Rebuild the project when the package is imported?
# editable.rebuild = true
# Explicitly include Python packages from src/
wheel.packages = ["src/mach"]
[tool.ruff]
target-version = "py310"
line-length = 120
fix = true
[tool.ruff.lint]
select = [
# flake8-2020
"YTT",
# flake8-bandit
"S",
# flake8-bugbear
"B",
# flake8-builtins
"A",
# flake8-comprehensions
"C4",
# flake8-debugger
"T10",
# flake8-simplify
"SIM",
# isort
"I",
# mccabe
"C90",
# pycodestyle
"E", "W",
# pyflakes
"F",
# pygrep-hooks
"PGH",
# pyupgrade
"UP",
# ruff
"RUF",
# tryceratops
"TRY",
]
ignore = [
# LineTooLong
"E501",
# DoNotAssignLambda
"E731",
# Long exception message
"TRY003",
# Forward annotations for jaxtyping
"F722",
# Allow if-else instead of ternary
"SIM108",
# Allow assert
"S101",
]
[tool.ruff.lint.per-file-ignores]
"test_*.py" = ["S101"]
"tests/*" = ["S101", "RUF001", "RUF003"]
"src/mach/_cuda_impl.pyi" = ["C408"] # nanobind.stubgen uses dict()
[tool.ruff.format]
preview = true
[tool.pytest.ini_options]
filterwarnings = [
"error", # make warnings errors
"ignore:.*This will add latency due to CPU<->GPU memory transfers.*:UserWarning",
# vbeam warnings
"ignore:point_position will be overwritten by the scan.:UserWarning",
"ignore:Both point_position and scan are set. Scan will be used.:UserWarning",
]
markers = [
# see conftest.py for default-addition of cuda marker
"cuda: mark test as requiring CUDA-enabled GPU (default for all tests)",
"no_cuda: mark test as NOT requiring CUDA (exception to the default)",
"slow: mark test as slow (skipped with --skip-slow)",
]
testpaths = ["tests"]
[tool.cibuildwheel]
build = [
"cp310-manylinux_x86_64",
"cp311-manylinux_x86_64",
"cp312-manylinux_x86_64",
"cp313-manylinux_x86_64",
]
# we don't use build-isolation, so we need to install
# build-requires explicitly.
# because cibuildwheel uses Docker, we also need to use --system
before-build = [
"uv pip install --system scikit-build-core>=0.10 nanobind>=2.7 ninja"
]
# Need --no-isolation to find nvcc
build-frontend = { name = "build[uv]", args = ["--no-isolation"] }
# Necessary to see build output from the actual compilation
build-verbosity = 1
[tool.cibuildwheel.linux]
# Use a builder image that already includes CUDA
# gcc version also needs to be compatible with the CUDA version
# https://stackoverflow.com/a/46380601/8094659
manylinux-x86_64-image = "sameli/manylinux2014_x86_64_cuda_12.3"