patchworks 0.11.15__tar.gz → 0.11.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {patchworks-0.11.15 → patchworks-0.11.16}/PKG-INFO +1 -1
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/config/config.yaml +4 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/profile/slurm/config.yaml +15 -3
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/scripts/merge.py +12 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/.github/workflows/docs.yml +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/.github/workflows/lint.yml +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/.github/workflows/release.yml +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/.gitignore +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/.markdownlint-cli2.yaml +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/LICENSE +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/README.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/cliff.toml +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/api/chunks.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/api/cluster.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/api/io.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/api/merge_tile_labels.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/api/plugins/cellpose.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/api/plugins/napari.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/api/plugins/ome_zarr.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/api/relabel.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/api/tile_process.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/assets/logo.png +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/examples/cellpose_2d.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/examples/cellpose_2d.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/examples/cellpose_3d.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/examples/cellpose_3d.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/examples/custom.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/examples/custom_method.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/examples/standalone_merge.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/examples/stardist.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/examples/stardist_2d.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/getting_started.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/guide/gpu_distributed.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/guide/merging.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/guide/ome_zarr_napari.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/guide/performance.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/guide/pitfalls.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/guide/skip_empty.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/guide/snakemake.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/guide/tiling.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/docs/index.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/mkdocs.yml +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/pyproject.toml +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/__init__.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/_chunks.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/_cluster.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/_core.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/_distributed.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/_io.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/_merge.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/_relabel.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/plugins/__init__.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/plugins/cellpose.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/plugins/napari.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/src/patchworks/plugins/ome_zarr.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/tests/test_core.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/tests/test_distributed.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/tests/test_napari.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/tests/test_ome_zarr.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/README.md +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/Snakefile +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/pixi.toml +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/rules/common.smk +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/rules/convert.smk +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/rules/merge.smk +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/rules/segment.smk +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/scripts/_pw.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/scripts/convert.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/scripts/fetch_model.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/scripts/prepare_tiles.py +0 -0
- {patchworks-0.11.15 → patchworks-0.11.16}/workflow/scripts/segment_tile.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: patchworks
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.16
|
|
4
4
|
Summary: Tiled processing of arbitrarily large images with globally consistent labels
|
|
5
5
|
Project-URL: Homepage, https://github.com/imcf/patchworks
|
|
6
6
|
Project-URL: Issues, https://github.com/imcf/patchworks/issues
|
|
@@ -51,3 +51,7 @@ cellpose:
|
|
|
51
51
|
pyramid_levels: 5
|
|
52
52
|
pyramid_downscale: 2
|
|
53
53
|
sequential_labels: true # renumber merged labels to a contiguous 1..N range
|
|
54
|
+
|
|
55
|
+
# ---- merge performance --------------------------------------------------
|
|
56
|
+
# null -> use the "merge" rule's actual cpus_per_task (profile/slurm/config.yaml).
|
|
57
|
+
merge_workers: null
|
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
# Edit the partitions / account / GPU request for your cluster.
|
|
6
6
|
|
|
7
7
|
executor: slurm
|
|
8
|
-
|
|
8
|
+
# Max concurrent SLURM jobs Snakemake will have in flight at once. This is a
|
|
9
|
+
# submission-side cap, not a cluster limit — raising it just lets more
|
|
10
|
+
# "segment" tiles queue/run together; scicore's scheduler still enforces your
|
|
11
|
+
# real GPU quota (MaxTRESPU) and backfills the rest, so it's safe to raise.
|
|
12
|
+
# Check your actual per-user GPU cap with:
|
|
13
|
+
# sacctmgr show assoc user=$USER format=account,partition,maxjobs,GrpTRES
|
|
14
|
+
jobs: 128
|
|
9
15
|
latency-wait: 60
|
|
10
16
|
rerun-incomplete: true
|
|
11
17
|
# Only re-run when an output is missing/stale — NOT when the patchworks code,
|
|
@@ -26,8 +32,12 @@ default-resources:
|
|
|
26
32
|
# Per-rule overrides.
|
|
27
33
|
set-resources:
|
|
28
34
|
convert:
|
|
35
|
+
# bioio/dask's default threaded scheduler uses every visible core, so
|
|
36
|
+
# this scales conversion for free. Verify actual scaling with `seff
|
|
37
|
+
# <jobid>` after a run and dial back if efficiency is low (scicore
|
|
38
|
+
# fair-share asks you not to sit on idle cores).
|
|
29
39
|
mem_mb: 64000
|
|
30
|
-
cpus_per_task:
|
|
40
|
+
cpus_per_task: 32
|
|
31
41
|
runtime: 360
|
|
32
42
|
prepare:
|
|
33
43
|
mem_mb: 32000
|
|
@@ -44,6 +54,8 @@ set-resources:
|
|
|
44
54
|
cpus_per_task: 4
|
|
45
55
|
runtime: 360 # 6 hours — must match the QOS, NOT 120 (=2h → killed early)
|
|
46
56
|
merge:
|
|
57
|
+
# merge_tile_labels now uses n_workers = this allocation (see merge.py /
|
|
58
|
+
# config.yaml's merge_workers) instead of silently capping at 4 threads.
|
|
47
59
|
mem_mb: 128000
|
|
48
|
-
cpus_per_task:
|
|
60
|
+
cpus_per_task: 32
|
|
49
61
|
runtime: 240
|
|
@@ -5,6 +5,7 @@ boundaries, optionally renumbers them) and writes the result back into the
|
|
|
5
5
|
image store under ``labels/<name>/`` as a calibrated, multi-scale pyramid.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
import os
|
|
8
9
|
import shutil
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
|
|
@@ -19,11 +20,17 @@ work_dir = cfg["work_dir"]
|
|
|
19
20
|
image_store = str(Path(work_dir) / "image.zarr")
|
|
20
21
|
merged_store = str(Path(work_dir) / "_merged.zarr")
|
|
21
22
|
|
|
23
|
+
# merge_tile_labels defaults to min(4, cpu_count) workers, so it ignores
|
|
24
|
+
# whatever cpus_per_task the "merge" rule was actually allocated in the SLURM
|
|
25
|
+
# profile. Read the real allocation (SLURM_CPUS_PER_TASK) so the job uses all
|
|
26
|
+
# the cores it's paying for; merge_workers: in config.yaml can still override.
|
|
27
|
+
default_workers = int(os.environ.get("SLURM_CPUS_PER_TASK", os.cpu_count() or 4))
|
|
22
28
|
merged = merge_tile_labels(
|
|
23
29
|
stage_path(work_dir),
|
|
24
30
|
write_to=merged_store,
|
|
25
31
|
input_component="staged",
|
|
26
32
|
sequential_labels=cfg.get("sequential_labels", True),
|
|
33
|
+
n_workers=cfg.get("merge_workers", default_workers),
|
|
27
34
|
progress=False,
|
|
28
35
|
)
|
|
29
36
|
group = write_labels(
|
|
@@ -37,5 +44,10 @@ group = write_labels(
|
|
|
37
44
|
|
|
38
45
|
shutil.rmtree(merged_store, ignore_errors=True)
|
|
39
46
|
shutil.rmtree(stage_path(work_dir), ignore_errors=True)
|
|
47
|
+
# Also drop the checkpoint's completion sentinel (stage.zarr.done): the
|
|
48
|
+
# "prepare" rule's stage=touch(STAGE_OK) output must not outlive the store it
|
|
49
|
+
# claims exists, or a future rerun (e.g. re-segmenting for new labels) skips
|
|
50
|
+
# "prepare" and "segment" tries to open a stage.zarr that's already gone.
|
|
51
|
+
Path(f"{stage_path(work_dir)}.done").unlink(missing_ok=True)
|
|
40
52
|
print(f"[patchworks] labels written to {group}")
|
|
41
53
|
open(snakemake.output[0], "w").close() # noqa: F821
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|