212 bug centroid nans sources not removed#213
Merged
ChaitanyaChawak merged 5 commits intoApr 28, 2026
Conversation
added 5 commits
April 22, 2026 13:21
… tests - Added support for filtering both NumPy arrays and sequence-based metadata (e.g. object IDs) based on mask alignment. - Added comprehensive unit tests covering edge cases such as partial invalid samples, fully invalid batches, and misaligned inputs. - Enforced stricter validation to prevent silent misalignment (e.g. raising on inconsistent array lengths or fully invalid batches). - Improved handling of array-like inputs and clarified expected behavior for aligned vs non-aligned data - Add missing changelog fragment for new utilities module pick 8b0e16b Update pull request template to include release prep
ChaitanyaChawak
approved these changes
Apr 28, 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.
Summary
Fixes an issue where sources with invalid centroid estimates (NaNs/Infs) were not removed, leading to downstream error during misalignment calculations using Centroid positions.
Introduces a robust batch filtering utility to enforce alignment and prevent silent data corruption.
Closes #212
What’s changed
safe_batchutilities to compute validity masks from anchor arrays (e.g. centroids) and filter aligned datasets.safe_batch_builderto consistently apply masking across all sample-aligned arrays (images, SEDs, masks, object IDs, etc.).How to test / verify
Scope
Changelog
Reviewer Checklist
develop, ormainfor release PRs)ruff)Next Steps / Notes (if applicable)