Repository navigation
fix: find segmenters at any depth below Segmenter - #80
Merged
paulmueller merged 2 commits intoNov 23, 2026
Merged
Conversation
`get_segmenters` only looked at the subclasses of the direct subclasses of `Segmenter` (e.g. `UNISegmenter` -> `SegmentThresh`). A custom segmenter derived from a concrete segmenter (e.g. from `SegmentThresh`) was therefore not found, and its pipeline identifier could not be resolved. All non-abstract subclasses at any depth are now registered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #80 +/- ##
==========================================
- Coverage 88.18% 88.14% -0.04%
==========================================
Files 63 63
Lines 4519 4522 +3
==========================================
+ Hits 3985 3986 +1
- Misses 534 536 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
paulmueller
approved these changes
Nov 23, 2026
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.
get_segmentersonly collected the subclasses of the direct subclasses ofSegmenter(e.g.UNISegmenter→SegmentThresh). A custom segmenter derived from a concrete segmenter was therefore never registered:This has been the case since custom segmenters were introduced (0.0.5).
Fix
get_segmenterswalks the subclass tree at any depth and registers every class that is not abstract (inspect.isabstract). The abstract intermediate classes (MPOSegmenter,STOSegmenter,UNISegmenter,TorchSegmenterBase) are still excluded, and the set of built-in segmenters is unchanged:thresh,torchmpo,torchsto,torchuni.get_segmenterskeeps itsfunctools.cache, as in the existing tests. A segmenter defined after the first call therefore still requiresget_segmenters.cache_clear().Tests
test_ppid_decoding_subclass_of_segmenter_subclass: registration, the PPID round trip, and that abstract bases are excluded. It fails on main and passes here.test_segm_threshcannot run locally because of a missing HDF5 plugin directory; this happens on main too). All 71 pipeline tests pass, run one per process locally.🤖 Generated with Claude Code