-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
181 lines (171 loc) · 6.57 KB
/
Copy pathpyproject.toml
File metadata and controls
181 lines (171 loc) · 6.57 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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "patchworks"
dynamic = ["version"]
description = "Tiled processing of arbitrarily large images with globally consistent labels"
readme = "README.md"
license = { text = "GPL-3.0-only" }
authors = [{ name = "Laurent Guerard", email = "laurent.guerard@unibas.ch" }]
keywords = [
"image processing",
"tiling",
"chunked",
"zarr",
"dask",
"segmentation",
"bioimage",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Image Processing",
]
# zarr-python 3 (itself Python >= 3.11) is required: NGFF 0.5 stores,
# sharding and the create_array API have no zarr-2 equivalent. It still
# writes NGFF 0.4 (zarr-v2 format) stores when asked to.
# Floors are the oldest releases the suite passes on (CI's "minimum
# versions" job holds them there): zarr < 3.0.3 hangs in the merge's
# forked workers, < 3.1.3 rejects tifffile's store; zarr 3.1 needs numpy
# 1.26; dask < 2024.10 fails 57 tests; scipy 1.11 is the first to build
# against numpy 1.26 on 3.11.
requires-python = ">=3.11"
dependencies = [
"dask[array]>=2024.10.0",
"numpy>=1.26",
"zarr>=3.1.3",
"scipy>=1.11",
# Free RAM bounds worker counts and auto tile sizes; without it a
# workstation (no SLURM, no cgroup limit) falls back to a blind 8 GiB.
"psutil",
]
[project.optional-dependencies]
io = ["psutil", "tqdm"]
cellpose = ["cellpose>=3.0"]
cellpose3 = ["cellpose>=3.0,<4"]
cellpose4 = ["cellpose>=4"]
# dog enables the deconvolution step in patchworks.plugins.dog (method:
# "custom" -> segment). cupy, for that plugin's use_gpu=True blur/label
# path, isn't included here — it's CUDA-version-specific (e.g.
# cupy-cuda12x), install it separately to match your CUDA version.
dog = ["pycudadecon"]
gpu = ["nvidia-ml-py"]
# remote reads/writes s3://, gs:// and https:// stores through fsspec
# (credentials come from the usual AWS/GCP environment or config files).
remote = ["fsspec[http,s3,gcs]"]
# distributed backs make_local_cluster and the live dashboard tile_process
# opens for single-GPU runs (it falls back to threads without it).
distributed = ["dask[distributed,diagnostics]"]
# bioio enables converting any image format (CZI, LIF, ND2, OME-TIFF, …) to
# OME-ZARR. Ships the common native readers (faster than going through Java)
# plus bioio-bioformats, the Bio-Formats catch-all reader (needs a JVM).
bioio = [
"bioio",
"bioio-bioformats",
"bioio-nd2",
"bioio-ome-tiff",
"bioio-czi",
"bioio-tifffile",
"bioio-lif",
]
# imaris reads .ims files natively (HDF5, no JVM) for OME-ZARR conversion.
imaris = ["imaris-ims-file-reader"]
# napari enables the interactive viewer plugin.
# - napari >= 0.7.1: adds locked_data_level (manual multiscale resolution pin
# for 2D *and* 3D) — before this, 3D view always showed the coarsest
# pyramid level unconditionally, with no way to change it.
# - numpy < 2.5: napari/numba don't support numpy 2.5 yet.
# - ipykernel < 7: napari-console requires ipykernel < 7.
# - lxml-html-clean: napari's notebook_display imports lxml.html.clean, split
# into a separate package in lxml >= 5.2 (else ImportError on Viewer()).
# - glasbey: distinct high-contrast label LUTs for view_in_napari.
# - napari-chunked-regionprops (https://github.com/imcf/napari-chunked-regionprops):
# out-of-core regionprops-style measurements (area/centroid/intensity
# stats) for huge Labels layers, straight off their backing dask/zarr
# arrays — the "Measure" dock widget. Formerly napari-dask-ndmeasure;
# renamed when its engine dropped dask_image.ndmeasure for a chunk-local
# map/merge that scales with chunk count, not object count.
# - pyqt6 < 6.10: PyQt6-Qt6 6.10.2's Windows wheel fails to import (`DLL load
# failed while importing QtWidgets: The specified procedure could not be
# found`) — confirmed unrelated to napari/qtpy, reproduces on a bare
# `from PyQt6.QtWidgets import QApplication`. 6.9.1 works; excluding the
# whole 6.10.x line until a fixed release is confirmed.
napari = [
"napari[all]>=0.7.1",
"numpy<2.5",
"ipykernel<7",
"lxml-html-clean",
"glasbey",
"napari-chunked-regionprops>=0.1.0",
"pyqt6<6.10",
]
# workflow runs the Snakemake pipeline (per-tile SLURM jobs across GPUs).
# openpyxl -> scripts/run_multi.py writes label_relations() output as an
# Excel workbook (per-object + per-container sheets), not a plain CSV.
workflow = ["snakemake>=8", "snakemake-executor-plugin-slurm", "openpyxl"]
# jsonschema validates what we write against the vendored official
# OME-NGFF schemas (tests/ngff_schemas/); without it that one test skips.
# openpyxl -> tests/test_run_multi.py checks the relations workbook.
# ruff is pinned to the version CI lints with (.github/workflows/lint.yml),
# so a local `ruff check` agrees with CI.
dev = [
"pytest",
"pytest-cov",
"scikit-image",
"psutil",
"tqdm",
"jsonschema>=4.18",
"openpyxl",
"ruff==0.15.18",
"mypy>=1.10",
]
docs = ["mkdocs-material>=9.0", "mkdocstrings[python]>=0.24"]
all = [
"patchworks[io,gpu,distributed,bioio,imaris,napari]",
"psutil",
"tqdm",
"scikit-image",
]
[project.scripts]
patchworks = "patchworks.cli:main"
[project.urls]
Homepage = "https://github.com/imcf/patchworks"
Issues = "https://github.com/imcf/patchworks/issues"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.wheel]
packages = ["src/patchworks"]
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.mypy]
python_version = "3.11"
files = ["src/patchworks"]
ignore_missing_imports = true
warn_unused_ignores = true
# Enforced now: arity and unpacking, undefined names and attributes, calls
# with wrong or missing arguments -- the classes that are real bugs here.
# Off for now: numpy/zarr/dask typing noise (zarr attrs are loosely typed
# JSON, dask's decorated methods confuse call checks, and variables such as
# tile_process's `image` are narrowed from "path or array" by reassignment).
# Tighten module by module by removing codes from this list.
disable_error_code = [
"union-attr",
"arg-type",
"index",
"operator",
"call-overload",
"type-var",
"func-returns-value",
"assignment",
"return-value",
]
[tool.ruff]
line-length = 80
target-version = "py311"