-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
225 lines (200 loc) · 5.8 KB
/
Copy pathpyproject.toml
File metadata and controls
225 lines (200 loc) · 5.8 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "organelle-mapping"
dynamic = ["version"]
description = "Segmenting organelles"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
keywords = []
authors = [{ name = "Larissa Heinrich", email = "heinrichl@janelia.hhmi.org" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"daisy",
"funlib.persistence>=0.6,<0.7",
"fibsem-tools>=7.0.5",
"matplotlib",
"funlib.learn.torch@git+https://git@github.com/funkelab/funlib.learn.torch.git",
"gunpowder",
"torch",
"click",
"sqlalchemy",
"xarray",
"xarray-datatree",
"zarr",
"scikit-image",
"xarray-multiscale",
"cellmap-schemas",
"pydantic-zarr",
"numcodecs",
"neuroglancer",
"dask",
"tensorboardX",
"xarray-ome-ngff",
"monai",
"einops",
"pydantic",
"scikit-learn",
"funlib.show.neuroglancer",
"tensorboard",
"tems>=1.0.4",
"torchinfo",
"corditea@git+https://github.com/saalfeldlab/corditea.git"
]
[project.optional-dependencies]
# Opt-in "lsd-jax" LSD backend. Pulls corditea's jax extra, which installs the
# (private) lsd-jax fork. Requires SSH access to the source and a working jax.
jax = ["corditea[jax]"]
[project.urls]
Documentation = "https://github.com/saalfeldlab/organelle-mapping#readme"
Issues = "https://github.com/saalfeldlab/organelle-mapping/issues"
Source = "https://github.com/saalfeldlab/organelle-mapping"
[project.scripts]
data_prep = "organelle_mapping.data_preparation:cli"
train = "organelle_mapping.run:main"
inference = "organelle_mapping.inference:cli"
evaluate = "organelle_mapping.evaluation:cli"
postprocess = "organelle_mapping.postprocessing:cli"
sync_db = "organelle_mapping.sync_db:cli"
[tool.hatch.version]
path = "src/organelle_mapping/__about__.py"
[tool.hatch.metadata]
allow-direct-references = true
source-layout = "src"
[tool.black]
target-version = ["py37"]
line-length = 120
skip-string-normalization = true
[tool.ruff]
target-version = "py37"
line-length = 120
extend-exclude = ["*.ipynb"]
[tool.ruff.lint]
select = [
"A",
"ARG",
"B",
"C",
"DTZ",
"E",
"EM",
"F",
"FBT",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S105",
"S106",
"S107",
# Ignore complexity
"C901",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
]
unfixable = [
# Don't touch unused imports
"F401",
]
[tool.ruff.lint.isort]
known-first-party = ["organelle_mapping"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
# Inference uses subprocess intentionally for worker spawning
"src/organelle_mapping/inference.py" = ["S603", "S607"]
[tool.coverage.run]
source_pkgs = ["organelle_mapping", "tests"]
branch = true
parallel = true
omit = ["src/organelle_mapping/__about__.py"]
[tool.coverage.paths]
organelle_mapping = ["src/organelle_mapping", "*/organelle-mapping/src/organelle_mapping"]
tests = ["tests", "*/organelle-mapping/tests"]
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.pixi.workspace]
channels = ["nvidia", "pytorch", "conda-forge"]
platforms = ["linux-64"]
[tool.pixi.activation.env]
MKL_NUM_THREADS = "1"
NUM_MKL_THREADS = "1"
OPENBLAS_NUM_THREADS = "1"
OPENMP_NUM_THREADS = "1"
OMP_NUM_THREADS = "1"
XLA_FLAGS = "--xla_cpu_multi_thread_eigen=false"
[tool.pixi.tasks]
test = "pytest -v"
test-cov = "coverage run -m pytest tests"
cov-report = { cmd = ["coverage combine", "coverage report"], depends-on = ["test-cov"] }
lint = "ruff check ."
format = "ruff format ."
fmt = { cmd = "ruff check --fix . && ruff format .", description = "Fix and format code" }
typecheck = "mypy --install-types --non-interactive src/organelle_mapping tests"
check-all = { depends-on = ["lint", "typecheck"], description = "Run all checks" }
[tool.pixi.dependencies]
python = "3.11.*"
xarray-datatree = "*"
[tool.pixi.pypi-dependencies]
organelle-mapping = { path = ".", editable = true }
# The override replaces corditea's requirement wholesale, so the `[jax]` extra
# must be named HERE — a bare `corditea[jax]` request elsewhere gets stripped by
# the override. This is what pulls the local corditea's lsd-jax into the dev env.
[tool.pixi.feature.local-deps.pypi-options]
dependency-overrides = { corditea = { path = "../corditea", editable = true, extras = ["jax"] } }
# Opt-in lsd-jax backend: activate organelle-mapping's own `jax` extra (which
# pulls corditea[jax] -> the private lsd-jax fork) and the CUDA jax build it
# runs on. Combine with local-deps so corditea[jax] resolves from the local
# checkout rather than public git.
[tool.pixi.feature.jax-backend.pypi-dependencies]
organelle-mapping = { path = ".", editable = true, extras = ["jax"] }
jax = { version = "*", extras = ["cuda13"] }
[tool.pixi.feature.dev.dependencies]
pytest = ">=7.3"
pytest-cov = ">=4.0"
coverage = ">=6.5"
ruff = ">=0.1.0"
mypy = ">=1.0"
black = ">=23.1.0"
jupyter = ">=1.0"
jupyterlab = ">=4.0"
ipykernel = ">=6.23"
[tool.pixi.feature.notebooks.dependencies]
jupyter = ">=1.0"
jupyterlab = ">=4.0"
ipykernel = ">=6.23"
[tool.pixi.environments]
default = { solve-group = "default" }
dev = { features = ["dev", "notebooks", "local-deps", "jax-backend"], solve-group = "dev" }