Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
164 lines (147 loc) · 4.68 KB
/
Copy pathpyproject.toml
File metadata and controls
164 lines (147 loc) · 4.68 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
[tool.poetry]
name = "verpex"
# Placeholder: the real version is derived from the latest git tag at build time by
# poetry-dynamic-versioning (see [tool.poetry-dynamic-versioning] below).
version = "0.0.0"
description = "Deep-learning prediction of anatomical points-of-interest (POIs) on vertebrae from CT/MRI spine segmentations."
authors = ["Hendrik Möller <hendrik.moeller@tum.de>"]
license = "Apache-2.0"
readme = "README.md"
packages = [{ include = "verpex" }]
include = [{ path = "verpex/configs/*.json" }, { path = "verpex/py.typed" }]
[tool.poetry.dependencies]
python = "^3.10 || ^3.11 || ^3.12"
TPTBox = ">=0.8"
TypeSaveArgParse = "*"
torch = ">=2.1"
pytorch-lightning = ">=2.1"
monai = ">=1.3"
numpy = ">=1.26"
pandas = ">=2.0"
scipy = ">=1.11"
scikit-image = ">=0.21"
scikit-learn = ">=1.4"
nibabel = ">=5.1"
PyYAML = ">=6.0"
tqdm = "*"
pqdm = "*"
openpyxl = "*"
einops = "*"
tensorboard = "*"
[tool.poetry.group.dev.dependencies]
pytest = ">=8.0"
poetry-dynamic-versioning = ">=1.0.0,<2.0.0"
ruff = ">=0.11"
pre-commit = "*"
coverage = ">=7.2"
mypy = ">=1.8"
pandas-stubs = "*"
types-PyYAML = "*"
[tool.poetry.group.extras.dependencies]
# Sparse-convolution backbones (SubmDenseNet). CUDA-specific; not required for
# the dense pipeline, so kept out of the default install.
spconv-cu120 = "*"
[tool.poetry.scripts]
verpex-prepare-data = "verpex.cli.prepare_data:main"
verpex-train = "verpex.cli.train:main"
verpex-train-cv = "verpex.cli.train_cv:main"
verpex-eval = "verpex.evaluation.metrics:main"
verpex-infer = "verpex.cli.infer:main"
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"
[tool.poetry-dynamic-versioning]
enable = true
[tool.ruff]
exclude = [".git", ".ruff_cache", ".venv", "venv", "build", "dist", "__pypackages__", "*.ipynb"]
line-length = 140
indent-width = 4
target-version = "py310"
[tool.ruff.lint]
select = [
"E", "F", "W", "I", "N", "UP", "B", "A", "C4", "ICN", "G", "PIE", "PYI",
"SIM", "TID", "ARG", "D", "ANN201", "PD", "PGH", "PL", "TRY", "FLY", "NPY",
"PERF", "FURB", "RUF",
]
ignore = [
"E501", # line length handled by the formatter
"BLE001",
"N801", "N802", "N803", "N806", "N999",
"NPY002",
"PLR0911", "PLR0912", "PLR0913", "PLR0915", "PLR2004",
"TRY003", "TRY301",
"SIM105", "SIM118",
"UP007",
"PLC0415",
# Rebinding a loop variable is this codebase's idiom for staged transforms
# (batch = to_device(batch); batch = model(batch)); renaming each stage hurts
# readability more than the shadowing costs.
"PLW2901",
"PLW0108",
"B905",
"D100", # module docstring - covered per-package
"D104", # package docstring
"D105", # magic method
"D107", # __init__ (covered by class docstring)
"D417",
"ANN202",
"RUF002",
]
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
# Re-exports in package __init__ files are intentional, not dead imports.
"**/__init__.py" = ["F401"]
"unit_tests/**" = ["D101", "D102", "D103", "D205", "D415", "ANN201", "ARG001"]
# Largely a vendored copy of MONAI's affine transforms, kept close to upstream so it
# stays diffable against it. The project's own transforms are at the top of the file
# and are documented; MONAI's docstring and typing style is left as-is.
"verpex/data/transforms.py" = [
"D101", "D102", "D103", "D205", "D415", "ANN201", "ARG002", "PGH003", "RUF012",
"N803", "N806", "UP035", "UP045", "RUF005", "B028", "C408",
]
[tool.ruff.lint.mccabe]
max-complexity = 20
[tool.pytest.ini_options]
testpaths = ["unit_tests"]
[tool.coverage.run]
source = ["verpex"]
branch = true
# Vendored MONAI transforms - exempted here the same way they are for ruff and mypy.
omit = ["verpex/data/transforms.py"]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod",
]
[tool.mypy]
python_version = "3.10"
files = ["verpex"]
warn_redundant_casts = true
warn_unused_ignores = true
no_implicit_optional = true
show_error_codes = true
[[tool.mypy.overrides]]
# Third-party packages that ship no stubs and no py.typed marker.
module = [
"TPTBox.*",
"TypeSaveArgParse.*",
"sklearn.*",
"spconv.*",
"monai.*",
"nibabel.*",
"skimage.*",
"scipy.*",
"pqdm.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# Largely a vendored copy of MONAI's affine transforms, kept close to upstream so
# it stays diffable against it - exempted here the same way it is for ruff.
module = "verpex.data.transforms"
ignore_errors = true