patchworks 0.11.3__tar.gz → 0.11.5__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.
Files changed (69) hide show
  1. {patchworks-0.11.3 → patchworks-0.11.5}/PKG-INFO +1 -1
  2. {patchworks-0.11.3 → patchworks-0.11.5}/docs/guide/snakemake.md +11 -2
  3. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/.snakemake/iocache/latest.pkl +0 -0
  4. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/README.md +3 -2
  5. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/pixi.toml +4 -2
  6. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/profile/slurm/config.yaml +4 -0
  7. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/rules/common.smk +4 -0
  8. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/rules/segment.smk +2 -2
  9. {patchworks-0.11.3 → patchworks-0.11.5}/.github/workflows/docs.yml +0 -0
  10. {patchworks-0.11.3 → patchworks-0.11.5}/.github/workflows/lint.yml +0 -0
  11. {patchworks-0.11.3 → patchworks-0.11.5}/.github/workflows/release.yml +0 -0
  12. {patchworks-0.11.3 → patchworks-0.11.5}/.gitignore +0 -0
  13. {patchworks-0.11.3 → patchworks-0.11.5}/.markdownlint-cli2.yaml +0 -0
  14. {patchworks-0.11.3 → patchworks-0.11.5}/README.md +0 -0
  15. {patchworks-0.11.3 → patchworks-0.11.5}/cliff.toml +0 -0
  16. {patchworks-0.11.3 → patchworks-0.11.5}/docs/api/chunks.md +0 -0
  17. {patchworks-0.11.3 → patchworks-0.11.5}/docs/api/cluster.md +0 -0
  18. {patchworks-0.11.3 → patchworks-0.11.5}/docs/api/io.md +0 -0
  19. {patchworks-0.11.3 → patchworks-0.11.5}/docs/api/merge_tile_labels.md +0 -0
  20. {patchworks-0.11.3 → patchworks-0.11.5}/docs/api/plugins/cellpose.md +0 -0
  21. {patchworks-0.11.3 → patchworks-0.11.5}/docs/api/plugins/napari.md +0 -0
  22. {patchworks-0.11.3 → patchworks-0.11.5}/docs/api/plugins/ome_zarr.md +0 -0
  23. {patchworks-0.11.3 → patchworks-0.11.5}/docs/api/relabel.md +0 -0
  24. {patchworks-0.11.3 → patchworks-0.11.5}/docs/api/tile_process.md +0 -0
  25. {patchworks-0.11.3 → patchworks-0.11.5}/docs/examples/cellpose_2d.md +0 -0
  26. {patchworks-0.11.3 → patchworks-0.11.5}/docs/examples/cellpose_2d.py +0 -0
  27. {patchworks-0.11.3 → patchworks-0.11.5}/docs/examples/cellpose_3d.md +0 -0
  28. {patchworks-0.11.3 → patchworks-0.11.5}/docs/examples/cellpose_3d.py +0 -0
  29. {patchworks-0.11.3 → patchworks-0.11.5}/docs/examples/custom.md +0 -0
  30. {patchworks-0.11.3 → patchworks-0.11.5}/docs/examples/custom_method.py +0 -0
  31. {patchworks-0.11.3 → patchworks-0.11.5}/docs/examples/standalone_merge.md +0 -0
  32. {patchworks-0.11.3 → patchworks-0.11.5}/docs/examples/stardist.md +0 -0
  33. {patchworks-0.11.3 → patchworks-0.11.5}/docs/examples/stardist_2d.py +0 -0
  34. {patchworks-0.11.3 → patchworks-0.11.5}/docs/getting_started.md +0 -0
  35. {patchworks-0.11.3 → patchworks-0.11.5}/docs/guide/gpu_distributed.md +0 -0
  36. {patchworks-0.11.3 → patchworks-0.11.5}/docs/guide/merging.md +0 -0
  37. {patchworks-0.11.3 → patchworks-0.11.5}/docs/guide/ome_zarr_napari.md +0 -0
  38. {patchworks-0.11.3 → patchworks-0.11.5}/docs/guide/performance.md +0 -0
  39. {patchworks-0.11.3 → patchworks-0.11.5}/docs/guide/pitfalls.md +0 -0
  40. {patchworks-0.11.3 → patchworks-0.11.5}/docs/guide/skip_empty.md +0 -0
  41. {patchworks-0.11.3 → patchworks-0.11.5}/docs/guide/tiling.md +0 -0
  42. {patchworks-0.11.3 → patchworks-0.11.5}/docs/index.md +0 -0
  43. {patchworks-0.11.3 → patchworks-0.11.5}/mkdocs.yml +0 -0
  44. {patchworks-0.11.3 → patchworks-0.11.5}/pyproject.toml +0 -0
  45. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/__init__.py +0 -0
  46. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/_chunks.py +0 -0
  47. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/_cluster.py +0 -0
  48. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/_core.py +0 -0
  49. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/_distributed.py +0 -0
  50. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/_io.py +0 -0
  51. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/_merge.py +0 -0
  52. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/_relabel.py +0 -0
  53. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/plugins/__init__.py +0 -0
  54. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/plugins/cellpose.py +0 -0
  55. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/plugins/napari.py +0 -0
  56. {patchworks-0.11.3 → patchworks-0.11.5}/src/patchworks/plugins/ome_zarr.py +0 -0
  57. {patchworks-0.11.3 → patchworks-0.11.5}/tests/test_core.py +0 -0
  58. {patchworks-0.11.3 → patchworks-0.11.5}/tests/test_distributed.py +0 -0
  59. {patchworks-0.11.3 → patchworks-0.11.5}/tests/test_napari.py +0 -0
  60. {patchworks-0.11.3 → patchworks-0.11.5}/tests/test_ome_zarr.py +0 -0
  61. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/Snakefile +0 -0
  62. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/config/config.yaml +0 -0
  63. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/rules/convert.smk +0 -0
  64. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/rules/merge.smk +0 -0
  65. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/scripts/_pw.py +0 -0
  66. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/scripts/convert.py +0 -0
  67. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/scripts/merge.py +0 -0
  68. {patchworks-0.11.3 → patchworks-0.11.5}/workflow/scripts/prepare_tiles.py +0 -0
  69. {patchworks-0.11.3 → patchworks-0.11.5}/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
3
+ Version: 0.11.5
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
@@ -102,11 +102,14 @@ known after `prepare` decides which tiles are non-empty.)
102
102
  ## 5a. Run locally (single machine)
103
103
 
104
104
  ```bash
105
- python -m snakemake -s Snakefile --configfile config/config.yaml --cores 8
105
+ python -m snakemake -s Snakefile --configfile config/config.yaml \
106
+ --rerun-triggers mtime --cores 8
106
107
  ```
107
108
 
108
109
  Tiles run on the local machine (one at a time on the GPU). Good for a small
109
- image or a smoke test.
110
+ image or a smoke test. `--rerun-triggers mtime` re-runs only steps whose output
111
+ is missing/stale — so upgrading patchworks won't redo the conversion (the SLURM
112
+ profile sets this for you).
110
113
 
111
114
  ## 5b. Run on SLURM (one GPU job per tile)
112
115
 
@@ -185,6 +188,12 @@ The OME-ZARR conversion is **not redone** once `image.zarr` exists: the
185
188
  on every later run. To force a fresh conversion, delete `image.zarr` or run
186
189
  `snakemake --forcerun convert`.
187
190
 
191
+ This relies on `--rerun-triggers mtime` (set in the SLURM profile and the pixi
192
+ tasks; add it on the command line for ad-hoc local runs). Without it, Snakemake
193
+ also re-runs a step when its **code, params or software environment** change —
194
+ so upgrading patchworks would re-do the conversion and overwrite an existing
195
+ result. Keep `mtime` and reruns happen only when an output is missing or stale.
196
+
188
197
  ## pixi (instead of conda)
189
198
 
190
199
  Conda is **not** required — Snakemake runs in whatever environment launches it.
@@ -56,10 +56,11 @@ account, GPU request).
56
56
  ## Run
57
57
 
58
58
  ```bash
59
- # locally (single machine)
60
- snakemake --cores 8 --configfile config/config.yaml
59
+ # locally (single machine) — mtime triggers => upgrades don't redo conversion
60
+ snakemake --cores 8 --configfile config/config.yaml --rerun-triggers mtime
61
61
 
62
62
  # on SLURM — one GPU job per tile, up to `jobs:` in parallel
63
+ # (the profile already sets --rerun-triggers mtime)
63
64
  snakemake --workflow-profile profile/slurm --configfile config/config.yaml
64
65
  ```
65
66
 
@@ -19,6 +19,8 @@ python = "3.12.*"
19
19
  patchworks = { version = "*", extras = ["workflow", "cellpose", "imaris", "bioio"] }
20
20
 
21
21
  [tasks]
22
- dry = "snakemake -s Snakefile --configfile config/config.yaml -n -p"
23
- go = "snakemake -s Snakefile --configfile config/config.yaml --cores 8"
22
+ # --rerun-triggers mtime: don't redo finished steps (e.g. the conversion) just
23
+ # because the patchworks version/code changed only when an output is missing.
24
+ dry = "snakemake -s Snakefile --configfile config/config.yaml --rerun-triggers mtime -n -p"
25
+ go = "snakemake -s Snakefile --configfile config/config.yaml --rerun-triggers mtime --cores 8"
24
26
  slurm = "snakemake --workflow-profile profile/slurm --configfile config/config.yaml"
@@ -8,6 +8,10 @@ executor: slurm
8
8
  jobs: 64 # max concurrent SLURM jobs (≈ how many GPUs you can grab at once)
9
9
  latency-wait: 60
10
10
  rerun-incomplete: true
11
+ # Only re-run when an output is missing/stale — NOT when the patchworks code,
12
+ # params or software env change. Stops an upgrade from re-doing the expensive
13
+ # conversion / re-segmenting an existing image.zarr.
14
+ rerun-triggers: mtime
11
15
  printshellcmds: true
12
16
  keep-going: true
13
17
 
@@ -9,6 +9,10 @@ IMAGE = f"{WORK}/image.zarr"
9
9
  IMAGE_OK = f"{IMAGE}/zarr.json"
10
10
  TILES = f"{WORK}/tiles.json"
11
11
  STAGE = f"{WORK}/stage.zarr"
12
+ # Completion sentinel for the stage store. Tracking a touch()ed marker instead
13
+ # of directory(STAGE) keeps Snakemake from deleting/recreating the store on a
14
+ # re-run and avoids directory-mtime quirks (same touch() discipline as sopa).
15
+ STAGE_OK = f"{STAGE}.done"
12
16
 
13
17
 
14
18
  def occupied_done(wildcards):
@@ -5,7 +5,7 @@ checkpoint prepare:
5
5
  IMAGE_OK,
6
6
  output:
7
7
  tiles=TILES,
8
- stage=directory(STAGE),
8
+ stage=touch(STAGE_OK),
9
9
  script:
10
10
  "../scripts/prepare_tiles.py"
11
11
 
@@ -14,7 +14,7 @@ rule segment:
14
14
  """Segment one tile on a GPU and write it into the stage store."""
15
15
  input:
16
16
  tiles=TILES,
17
- stage=STAGE,
17
+ stage=STAGE_OK,
18
18
  image=IMAGE_OK,
19
19
  output:
20
20
  f"{WORK}/seg/{{index}}.done",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes