Repository navigation
fix: honor an explicit size_thresh_mask=0 in Gate - #86
Merged
paulmueller merged 1 commit intoNov 23, 2026
Merged
Conversation
`Gate` used `size_thresh_mask or 10`, so an explicit 0 (passed by the user or taken from the "bin area min" metadata with online gates) was silently replaced by the default value 10. A gate created from a pipeline identifier with "s=0" therefore had the identifier "s=10". The default is now only used if `size_thresh_mask` is None. 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 #86 +/- ##
=======================================
Coverage 88.21% 88.22%
=======================================
Files 63 63
Lines 4541 4543 +2
=======================================
+ Hits 4006 4008 +2
Misses 535 535 ☔ 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.
Gate.__init__set"size_thresh_mask": size_thresh_mask or self._default_size_thresh_mask. An explicit0is falsy, so it was silently replaced by the default value 10. This happened both when the user passedsize_thresh_mask=0and whenonline_gates=Truetook0from the "online_contour:bin area min" metadata.As a result, a gate built from a pipeline identifier with
s=0reporteds=10in its own identifier, and masks with 1–10 pixels were dropped although the user asked to keep them.Decision (discussed with the maintainer): honor an explicit 0.
Fix
The default is only used when
size_thresh_maskis None (not given, and not found in the metadata with online gates). The docstring mentions that 0 keeps all non-empty masks.Results change only for users who explicitly passed 0, or who use online gates on files where "bin area min" is 0.
Tests
test_gate_mask_size_thresh_zero: an explicit 0 givesnorm:o=0^s=0and keeps a 1-pixel mask; 0 from the metadata with online gates givesnorm:o=1^s=0; and the PPID round trip. It fails on main (10 == 0) and passes here.🤖 Generated with Claude Code