Skip to content

feat(workflow): custom per-tile function via method: custom - #33

Merged
lguerard merged 1 commit into
mainfrom
feat/workflow-custom-fn
Jun 25, 2026
Merged

feat(workflow): custom per-tile function via method: custom#33
lguerard merged 1 commit into
mainfrom
feat/workflow-custom-fn

Conversation

@lguerard

Copy link
Copy Markdown
Contributor

Summary

Run your own per-tile function on the cluster without touching the package:

method: "custom"
custom:
  module: "my_seg"       # file in workflow/scripts/, on PYTHONPATH, or pip-installed
  function: "segment"    # def segment(tile) -> int32 labels
  kwargs: {}

build_fn imports the module/function and forwards kwargs. Everything else — tiling, halos, zarr-native merge, resume, per-tile logs — is unchanged. fetch_model no-ops for non-Cellpose methods.

New guide section documents the function contract, the three ways to make the module importable, and a cluster checklist (env deps, offline weight prefetch).

Test

Added a throwaway scripts/my_seg.py, ran method: custom end-to-end → 13/13, labels written, prefetch skipped. Removed the throwaway before commit.

🤖 Generated with Claude Code

Let users plug their own segmentation function without editing the
package: `method: "custom"` imports `cfg.custom.{module,function}` and
forwards optional kwargs. The module just needs to be importable on the
cluster (a file in workflow/scripts/, on PYTHONPATH, or pip-installed).
Document the function contract, the import options and the cluster
checklist (env deps, offline prefetch) in the guide.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lguerard
lguerard merged commit 96f3f33 into main Jun 25, 2026
2 checks passed
@lguerard
lguerard deleted the feat/workflow-custom-fn branch June 25, 2026 12:15
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