Skip to content

fix(workflow): skip OME-ZARR conversion when the store already exists - #26

Merged
lguerard merged 1 commit into
mainfrom
fix/workflow-skip-convert
Jun 24, 2026
Merged

fix(workflow): skip OME-ZARR conversion when the store already exists#26
lguerard merged 1 commit into
mainfrom
fix/workflow-skip-convert

Conversation

@lguerard

Copy link
Copy Markdown
Contributor

Summary

Re-running the workflow no longer redoes the (expensive) OME-ZARR conversion if image.zarr already exists.

Adopts the idiomatic Snakemake approach used by imcf/sopa: the convert rule's output: is a single marker file inside the store (image.zarr/zarr.json) instead of directory(IMAGE). Snakemake then:

  • natively skips convert when the marker exists (no custom guard / config flag), and
  • does not wipe the whole store before a re-run (the directory() pre-delete hazard).

Downstream rules depend on the marker file. Removed the earlier overwrite_zarr flag and in-script existence check.

To force a fresh conversion: delete image.zarr or snakemake --forcerun convert.

Test

End-to-end on a synthetic CZYX OME-TIFF (threshold method, no GPU):

  • Run 1 (fresh): 12/12 steps, labels written.
  • Run 2 (wiped Snakemake metadata + downstream outputs, kept image.zarr): job stats list only prepare+segment+mergeconvert absent, store reused. 11/11 done.

🤖 Generated with Claude Code

Make the convert rule's output a marker file inside the store
(image.zarr/zarr.json) instead of directory(IMAGE), mirroring the
sopa ".zgroup trick". Snakemake then natively skips conversion when the
store already exists and never wipes the whole store on a re-run, so an
expensive convert is not redone. Downstream rules depend on the marker.

Drops the earlier overwrite_zarr config flag / in-script existence guard
in favour of plain Snakemake DAG semantics.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lguerard
lguerard merged commit babe396 into main Jun 24, 2026
2 checks passed
@lguerard
lguerard deleted the fix/workflow-skip-convert branch June 24, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant