Repository navigation
Feat/trident x hooks - #242
Merged
Merged
Conversation
Small, backward-compatible changes so packages built on TRIDENT can extend it without copying its source. - WSI: picklable (`__getstate__` drops the live handle) and `_ensure_open()` reopens it on first read in each reader, so a WSI can cross into spawned DataLoader workers. - WSIPatcherDataset: module-level `collate_pil_batch` for PIL batches. - Model families: `BasePatchEncoder`, `BaseSlideEncoder` and `BaseSegmentationModel` (renamed from `SegmentationModel`, alias kept) are ABCs with a uniform `.name`, and are exported from their subpackages. - Processor: scope state task keys per coords config (`coords:<dir>`, `patch_features:<enc>:<dir>`, `slide_features:<enc>:<dir>`) and record only outputs that were actually written. - State/Summary: group any scoped `<family>:<scope>` task generically; reset a task's stale reason on a new outcome; clear a resolved `last_error`. - visualize_coords: report the coords' real overlap. - IO.collect_valid_slides: `max_workers=0` validates paths synchronously. - TITAN: shim for transformers versions without `all_tied_weights_keys`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fallback built a coords-only patcher and left `coords` / `coords_attrs` unbound, so extracting features from legacy coords always failed: workers received coordinates where images were expected, then saving raised NameError. Read the legacy file once, build an image patcher, and save its coords and attributes with the features. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found while reviewing this PR against main. - CZIWSI kept its open-file context (`_ctx`) when pickled, so CZI slides still failed in spawned DataLoader workers. Drop it like `img`. - The spawn fallback did not recognise Python >= 3.10's "cannot pickle" wording, so an unpicklable reader crashed when it could have fallen back. - A job dir started before scoped state keys has both "coords" and "coords:<dir>"; the per-slide summary overwrote the old status. Keep it under "unscoped". - Tests: slides pickle and give the same features in spawn workers; CZI pickle round-trip; mixed old/new keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.