Repository navigation
chore: annotate ImagePointFeatures and document estimate and plot_correspondence - #257
Merged
Merged
Conversation
…respondence Part of Issue 60. Annotates the remaining parameters in ImagePointFeatures.py: __getitem__ of BaseFeature2D and FeatureMatch (an int, slice, sequence of ints or array), __radd__, FeatureMatch.__init__ and _image2feature. Gives FeatureMatch, the mixin, estimate and plot_correspondence docstrings. Two type: ignore comments mark a bug found while typing: indexing a FeatureMatch by an int, or by an int or bool array, leaves its inlier status as a bool or a list, so outliers then fails. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 high |
🟢 Metrics 0 complexity · 0 duplication
Metric Results Complexity 0 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.
Annotates
ImagePointFeatures.py, the next file in the type-hint work of Issue 60 (12 of 110 parameters were unannotated). Annotation and docstring changes only, no behaviour change.BaseFeature2D.__getitem__andFeatureMatch.__getitem__takeint | slice | Sequence[int] | np.ndarray, which is what they accept (an index array of ints or bools too, andBagOfWordsindexes with a bool array). The docstrings said "int or slice".__radd__takes a feature set, a list, an int orNone, as__add__andsum()need.FeatureMatch.__init__(m, inliers)and_image2featureare typed.FeatureMatchand the mixin had none, andFeatureMatch.estimateandplot_correspondencehad none. They do now.estimate()sets the inlier mask, indexing aFeatureMatchby an int leaves a barebool, and indexing by an int or bool array leaves alist(a slice is fine). Then.outliersraisesTypeError(~of a list) orValueError. Two narrow# type: ignore[...]comments mark the lines, with a comment saying so.I left alone the 26
:seealso:fields and 39Example:blocks, which AGENTS.md says to migrate gradually.mypy reports no issues and the full suite passes (2158 passed, 33 skipped).
AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.
🤖 Generated with Claude Code