Repository navigation
fix: keep the inlier status of a FeatureMatch an array when it is indexed - #265
Merged
Merged
Conversation
…exed FeatureMatch.__getitem__ left the inlier status as a bare bool for an int index and as a list for a bool or int array index, so inliers and outliers then failed (~ of a list, or indexing by a bool). It now stores the status as a bool array and indexes it with the same index. A list or tuple index, which the error message said was allowed but raised ValueError, now works. status raised ValueError for more than one match, and now gives one string per match. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 9 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Fixes bug list item 34, found while typing
ImagePointFeatures.py(Issue 60), and two moreFeatureMatchfailures next to it. I reproduced all of them with ORB matches of the two Eiffel images afterestimate()set the inlier status.FeatureMatch.__getitem__left the status as a bareboolfor an int index, and as alistfor a bool or int array index (a slice was fine). Then.outliersraisedTypeError(~of a list), and.inliersor.outliersof one match raisedValueError(indexing by a bool). The status is now stored as aboolarray, whatever it was given as, and indexed with the same index as the matches. The two# type: ignorecomments that marked the bug are gone.matches[[0, 1, 2]]raisedValueError: index must be an int, slice, sequence or array, though a sequence is one of the things the message lists, andBaseFeature2Daccepts a list. A list or tuple of ints or bools now works, as does an empty one. A string is still refused.status. It raisedValueError(the truth value of an array) for more than one match. It now gives"+","-"or""per match, and a single string for one match, as thescalar_resultdecorator does for other properties. The docstring said:rtype: bool, and now says what it returns. It has a.. versionchanged:: 2.5.0note.Tests: the status stays an array of the right length for an int, slice, bool array, int array, list, tuple and bool list index, inliers and outliers of a selection and of one match,
statusof many matches (set and unset), inliers given as a list, and list and tuple indexing. 11 of them fail on the old code. mypy reports no issues and the full suite passes (2171 passed, 33 skipped).AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.
🤖 Generated with Claude Code