-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
315 lines (291 loc) · 7.24 KB
/
pyproject.toml
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
[build-system]
requires = [
"setuptools>=64",
"setuptools_scm[toml]>=8"
]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
locan = ["py.typed", "*.pyi"]
[tool.setuptools_scm]
version_file = "src/locan/_version.py"
version_scheme = "release-branch-semver"
fallback_version = "0.20-fallback"
[project]
name = "locan"
description = "Analysis software for single-molecule localization microscopy"
readme = "README.md"
requires-python = ">=3.9"
license = {file = "LICENSE.md"}
authors = [
{name = "Locan Developers"},
]
maintainers = [
{name = "Sören Doose"}
]
keywords = [
"fluorescence", "super-resolution", " single-molecule localization microscopy",
"smlm", "storm", "dstorm", "palm", "paint"
]
classifiers = [
"Environment :: Console",
"Development Status :: 3 - Alpha",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: C",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dynamic = ["version"]
dependencies = [
"asdf",
"boost-histogram",
"cython",
"fast-histogram",
"lazy_loader>=0.3",
"lmfit",
"matplotlib",
"networkx",
"numpy>1.20.0",
"pandas",
"protobuf<5",
"qtpy!=2.3.0",
"ruamel.yaml",
"scikit-image",
"scikit-learn",
"scipy",
"shapely!=2.0.0,!=2.0.1",
"tifffile",
"tomli>=1.1.0; python_version<'3.11'",
"tqdm",
"typing_extensions",
]
[project.optional-dependencies]
color = ["colorcet"]
hdbscan = ["hdbscan"]
hdf5 = ["h5py"]
html = ["requests"]
napari = ["napari"]
pyqt5 = ["PyQt5"]
pyside2 = ["PySide2"]
register = [
"open3d-cpu!=0.12.0; platform_system=='Linux' and python_version<'3.12'",
"open3d!=0.12.0; platform_system!='Linux' and python_version<'3.12'"]
scatter_density = ["mpl_scatter_density"]
test = [
"pytest",
]
test-qt = [
"pytest",
"pytest-qt;python_version<'3.13'",
"PyQt5",
]
track = ["trackpy"]
all = [
"colorcet",
"hdbscan",
"h5py",
"PyQt5",
"locan[register]",
"locan[test]",
"mpl_scatter_density",
"napari",
"requests",
"trackpy",
]
gpu = [
"cupy",
"open3d!=0.12.0; python_version<'3.12'"
]
docs = [
"furo",
"ipython",
"myst-nb",
"ray[default]",
"sphinx",
"sphinx-autodoc-typehints",
"sphinx-copybutton",
]
dev = [
"asv",
"black~=24.0",
"build",
"coverage[toml]",
"mypy",
"pandas-stubs", # required by mypy
"pre-commit",
"ruff",
"twine",
"types-protobuf", # required by mypy
"types-requests", # required by mypy
"types-tqdm", # required by mypy
]
[project.urls]
homepage = "https://github.com/super-resolution/locan"
documentation = "https://locan.readthedocs.io/"
repository = "https://github.com/super-resolution/locan"
issues = "https://github.com/super-resolution/locan/issues"
changelog = "https://github.com/super-resolution/locan"
[project.scripts]
locan = "locan.__main__:main"
[tool.black]
line_length = 88
[tool.pytest.ini_options]
filterwarnings = [
"ignore:RoiLegacy.to_yaml is deprecated*:DeprecationWarning",
"ignore::DeprecationWarning:hdbscan",
]
addopts = "-m 'not gui and not visual'"
markers = [
"gui: marks tests that require user interaction (skipped by default)",
"visual: marks tests that require visual inspection (skipped by default)",
]
[tool.coverage.run]
include = [
"src/locan/*"
]
omit = [
"src/locan/tests/*",
"src/locan/scripts/*",
"src/locan/__main__.py",
"src/locan/data/metadata_pb2.py",
"src/locan/data/metadata_pb2.pyi",
"src/locan/analysis/metadata_analysis_pb2.py",
"src/locan/analysis/metadata_analysis_pb2.pyi",
"src/locan/locan_io/locdata/manifest_pb2.py",
"src/locan/locan_io/locdata/manifest_pb2.pyi",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.ruff]
line-length = 88
show-source = false
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"Q", # flake8-quotes
"YTT", # flake8-2020
"S", # flake8-bandit
"UP", # pyupgrade
"BLE", # flake8-blind-exception
"ISC", # flake8-implicit-str-concat
"NPY", # numpy-specific rules
# "PT", # flake8-pytest-style
]
# Rules - https://github.com/charliermarsh/ruff#reference:
# B905 `zip()` without an explicit `strict=` parameter - should be used from py310.
# E402 module-import-not-at-top-of-file
# E501 line-too-long
# F403 import-star-used
# F405 undefined-local-with-import-star-usage
# I001 unsorted-imports
# Q000 bad-quotes-inline-string
# S101 assert
# S307 suspicious-eval-usage
# S605 start-process-with-a-shell
# S607 start-process-with-partial-path
ignore = ["E501", "B905"]
# automatically exclude files that are ignored by .gitignore
exclude = [
".*",
"dist",
"docs",
"docker",
"*/*_pb2.py",
"*/*_pb2.pyi",
"src/locan/_version.py",
]
[tool.ruff.per-file-ignores]
"__init__.py" = ["E402", "F401", "F403", "F405", "I001"]
"__init__.pyi" = ["E401", "F401", "I001"]
"test_*.py" = ["S101", "S307", "S403", "S605", "S607"]
"test_simulation.py" = ["F841"]
"benchmarks/benchmarks/*.py" = ["S101"]
[tool.ruff.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.flake8-import-conventions]
[tool.ruff.flake8-import-conventions.aliases]
numpy = "np"
pandas = "pd"
matplotlib = "mpl"
"matplotlib.pyplot" = "plt"
open3d = "o3d"
scipy = "sp"
networkx = "nx"
boost_histogram = "bh"
[tool.ruff.pydocstyle]
convention = "numpy"
[tool.ruff.lint]
extend-select = ["NPY201"]
preview = true
[tool.mypy]
plugins = ['numpy.typing.mypy_plugin']
files = ["src"]
strict = true
# warn-unused-ignores is not quite reproducible
warn_unused_ignores = false
# exclude autogenerated protobuf files
[[tool.mypy.overrides]]
module = [
'locan.analysis.metadata_analysis_pb2',
'locan.data.metadata_pb2',
'locan.locan_io.locdata.manifest_pb2',
]
ignore_errors = true
# all attr-defined errors are due to star imports
[[tool.mypy.overrides]]
module = [
'locan.tests.*',
]
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false
disable_error_code = ["attr-defined"]
[[tool.mypy.overrides]]
module = [
'asdf',
'colorcet',
'fast_histogram',
'h5py',
'hdbscan',
'lmfit.*',
'mpl_scatter_density',
'napari',
'networkx',
'open3d',
'scipy.*',
'shapely.*',
'sklearn.*',
'trackpy',
'vispy',
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
'locan.visualize.transform',
'locan.analysis.nearest_neighbor',
'locan.analysis.localization_precision',
]
disallow_subclassing_any = false