forked from deepinv/deepinv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
243 lines (208 loc) · 6.19 KB
/
Copy pathpyproject.toml
File metadata and controls
243 lines (208 loc) · 6.19 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
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"
[project]
name = "deepinv"
authors = [{name="DeepInverse maintainers (see https://github.com/deepinv/deepinv/blob/main/MAINTAINERS.md)"}]
license = { text = "BSD-3-Clause" }
description = "DeepInverse: a PyTorch library for imaging with deep learning"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Utilities",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries",
]
requires-python = ">=3.10"
version = "0.4.0"
dependencies = [
"numpy",
"matplotlib",
"tqdm",
"torch>=2.2.0",
"torchvision",
"torchmetrics",
"einops",
"requests",
"h5py",
"natsort",
]
[tool.setuptools]
platforms = ["any"]
[tool.setuptools.packages]
find = { where = ["."] }
[project.readme]
file = "README.rst"
content-type = "text/x-rst"
[project.urls]
Homepage = "https://deepinv.github.io/"
Source = "https://github.com/deepinv/deepinv"
Tracker = "https://github.com/deepinv/deepinv/issues"
[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
"pytest-xdist",
"coverage",
"pytest-testmon",
]
doc = [
"sphinx",
"sphinx_gallery",
"pydata_sphinx_theme",
"sphinxemoji",
"sphinx_copybutton",
"sphinx_autoapi",
"sphinx-design",
"sphinx_sitemap<2.7.0",
"sphinxcontrib.bibtex",
"nbformat",
]
lint = [
"black",
"ruff"
]
# optional dependencies for specific denoisers, or transforms
denoisers = [
"bm3d",
"bm4d<4.2.4",
"timm",
"PyWavelets",
"ptwt",
"kornia",
"libcpab",
"scipy",
"diffusers",
"transformers",
"numba>=0.60.0",
]
# optional dependencies for advanced forward operators
physics = [
"astra-toolbox>=2.2.0,!=2.3.0; platform_system=='Linux'",
"spyrit>=3.0.0; platform_system=='Linux'",
"torchkbnufft",
"array_api_compat",
"sigpy",
]
# optional dependencies for specific datasets
dataset = [
"datasets",
"pandas",
"pydicom",
"mat73",
"scipy",
"nibabel",
"rasterio",
"blosc2",
]
# optional dependencies for training
training = [
"wandb",
"mlflow",
]
##############################################################
# Pixi configuration for managing conda optional dependencies
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64", "win-64"]
[tool.pixi.dependencies]
python = "<3.13.0"
pytorch = "*"
torchvision = "*"
numpy = "*"
matplotlib = "*"
tqdm = "*"
torchmetrics = "*"
einops = "*"
requests = "*"
h5py = "*"
natsort = "*"
[tool.pixi.feature.gpu.system-requirements]
cuda = "12.0"
[tool.pixi.feature.gpu.dependencies]
cuda-version = "*"
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
[tool.pixi.feature.dataset.dependencies]
datasets = ">=3.5.0"
pandas = "*"
scipy = "*"
nibabel = "*"
rasterio = "*"
pydicom = "*"
# mat73 is PyPI-only, stays in optional deps
[tool.pixi.feature.denoisers.dependencies]
scipy = "*"
kornia = "*"
pywavelets = "*"
numba = ">=0.60.0"
timm = "*"
diffusers = "*"
transformers = "*"
# bm3d, bm4d, libcpab, ptwt are PyPI-only, stay in optional deps
[tool.pixi.feature.physics.dependencies]
astra-toolbox = ">=2.2.0,!=2.3.0"
torchkbnufft = "*"
array-api-compat = "*"
sigpy = "*"
# spyrit is PyPI-only, stays in optional deps
[tool.pixi.feature.training.dependencies]
wandb = "*"
mlflow = "*"
[tool.pixi.pypi-dependencies] # install from PyPI for all environments
deepinv = { path = ".", editable = true}
[tool.pixi.environments]
# gpu environments
default = { features = ["gpu"], solve-group = "gpu" }
test = { features = ["gpu", "test"], solve-group = "gpu" }
full = { features = ["gpu", "doc", "test", "dataset", "denoisers", "physics", "training"], solve-group = "gpu" }
docs = { features = ["gpu", "doc", "dataset", "denoisers", "physics", "training", "py312"], solve-group = "gpu-docs" }
doctest = { features = ["gpu", "doc", "test", "dataset", "denoisers", "physics", "training", "py312"], solve-group = "gpu-docs" }
# cpu environments (same as gpu but without the gpu dependencies)
test-cpu = { features = ["test"], solve-group = "cpu" }
full-cpu = { features = ["doc", "test", "dataset", "denoisers", "physics", "training"], solve-group = "cpu" }
docs-cpu = { features = ["doc", "dataset", "denoisers", "physics", "training", "py312"], solve-group = "cpu-docs" }
doctest-cpu = { features = ["doc", "test", "dataset", "denoisers", "physics", "training", "py312"], solve-group = "cpu-docs" }
##############################################
# Pytest configuration and coverage reporting
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = [
"deepinv/tests", # main test directory
"deepinv", # for doctests in the codebase
]
markers = [
"slow",
]
[tool.coverage.run]
branch = false
omit = ['examples/*', 'deepinv/tests'] # define paths to omit
[tool.coverage.report]
show_missing = true
skip_covered = true
exclude_also = [
"if self.mlflow_vis",
]
##############################################
# Ruff configuration for linting and import management
[tool.ruff]
target-version = "py310"
[tool.ruff.lint]
select = ["UP006", "F401", "B905", "B006", "RUF008", "RUF012", "TID253", "UP004", "A005", "UP007", "UP045", "FA100", "FA102", "TID251", "N805", "E402", "F821", "F822", "F823"]
[tool.ruff.lint.per-file-ignores]
# NOTE: Rule F401 is ruff's unused imports rule.
"__init__.py" = ["F401"]
"deepinv/__init__.py" = ["E402"]
"examples/**/*" = ["TID253", "E402"]
[tool.ruff.lint.flake8-tidy-imports]
# Modules that slow down startup and should be imported lazily
banned-module-level-imports = ["timm", "torchmetrics", "matplotlib", "datasets", "bm3d", "einops", "wandb", "pandas", "kornia", "ptwt", "pywt", "astra", "torchkbnufft"]
# Deprecated functions that should be replaced
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"torch.norm".msg = "Use torch.linalg.vector_norm, torch.linalg.matrix_norm or torch.linalg.norm instead of the deprecated torch.norm"