Repository navigation
Fix invalid syntax (N, 2) array: docstub fixes (VII). - #8027
Conversation
📝 WalkthroughWalkthroughDocstrings across feature, measure, and transform modules were updated to explicitly state ndarray shapes (e.g., "ndarray of shape (N, 2)"). The CI typing workflow docstub step had its Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/skimage/feature/orb.py`:
- Line 62: The docstring for the `keypoints` attribute in
src/skimage/feature/orb.py repeats the shape twice; update the `keypoints`
description to remove the redundant `(N, 2)` prefix so it reads in the standard
form (e.g., "ndarray of shape (N, 2)") and ensure similar formatting is used for
other attributes in the same docstring for consistency with the rest of the PR.
🧹 Nitpick comments (1)
src/skimage/transform/_geometric.py (1)
1712-1718: Inconsistent return shape in docstring.The parameter
coordsis documented asarray_like of shape (N, D)to support D-dimensional coordinates, but the return type is documented asarray of shape (N, 2). Since the implementation at line 1722 usesnp.empty_like(coords, np.float64), the output shape matches the input shape.Consider updating the return docstring to match the parameter's dimensionality:
♻️ Suggested fix
Returns ------- - coords : array of shape (N, 2) + coords : ndarray of shape (N, D) Transformed coordinates.
# Conflicts: # .github/workflows/typing.yml
) ## Description Follows scikit-image#8026, going through the list of docstub errors, from the bottom up. Fixing similar errors in nearby lines in the same files along the way. ## Checklist <!-- Before pull requests can be merged, they should provide: --> - A descriptive but concise pull request title - [Docstrings for all functions](https://github.com/numpy/numpydoc/blob/main/doc/example.py) - [Unit tests](https://scikit-image.org/docs/dev/development/contribute.html#testing) - A gallery example in `./doc/examples` for new features - [Contribution guide](https://scikit-image.org/docs/dev/development/contribute.html) is followed ## Release note For maintainers and optionally contributors, please refer to the [instructions](https://scikit-image.org/docs/stable/development/contribute.html#documenting-changes) on how to document this PR for the release notes. ```release-note ... ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified parameter and attribute docs across feature-detection, descriptor, measurement, and geometric-transformation APIs—replacing vague “array”/“array-like” descriptions with explicit ndarray shape specifications (e.g., shapes for images, keypoints, scales, orientations, descriptors, positions, residuals). These updates improve consistency and make expected input/output shapes clearer in public documentation. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Lars Grüter <[email protected]>
Description
Follows #8026, going through the list of docstub errors, from the bottom up. Fixing similar errors in nearby lines in the same files along the way.
Checklist
./doc/examplesfor new featuresRelease note
For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.