Skip to content

Fix invalid syntax (N, 2) array: docstub fixes (VII). - #8027

Merged
mkcor merged 5 commits into
scikit-image:mainfrom
mkcor:docstub-fixes-VII
Jan 19, 2026
Merged

mkcor merged 5 commits into
scikit-image:mainfrom
mkcor:docstub-fixes-VII

Conversation

@mkcor

@mkcor mkcor commented Jan 18, 2026 •

Copy link
Copy Markdown
Member

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

Release note

For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.

...

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.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 18, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Docstrings 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 --allow-errors threshold lowered from 792 to 744. No executable code or public signatures were modified.

Changes

Cohort / File(s) Summary
Workflow configuration
\.github/workflows/typing.yml
Lowered docstub --allow-errors value from 792 → 744 in the "Create skimage-stubs with docstub" step; command structure unchanged.
Feature detection docstrings
src/skimage/feature/brief.py, src/skimage/feature/censure.py, src/skimage/feature/orb.py, src/skimage/feature/sift.py
Rewrote parameter and public-attribute descriptions to use explicit "ndarray of shape ..." wording (keypoints, scales, orientations, responses, descriptors, images); no behavioral changes.
Utility / measurement / transform docstrings
src/skimage/feature/util.py, src/skimage/measure/fit.py, src/skimage/transform/_geometric.py
Updated docstrings to specify ndarray or array_like shapes for parameters and returns (e.g., (N, 2) → ndarray of shape (N, 2)); no signature or logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • mkcor

Poem

🐰 I hop through docstrings, nibbling vague arrays,
"ndarray of shape" now lights my ways,
CI trims the threshold, the rabbits cheer,
Clean shapes, clear lines — documentation near,
A tiny hop for code, a joyful ear.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing invalid syntax in docstring array notation (e.g., '(N, 2) array') across multiple files as part of a docstub fixes series.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@mkcor mkcor added 🔧 type: Maintenance Refactoring and maintenance of internals 🧩 typing Type annotations, type checking, and stubs labels Jan 18, 2026
@mkcor
mkcor requested a review from lagru January 18, 2026 21:30
Comment thread src/skimage/feature/brief.py Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 coords is documented as array_like of shape (N, D) to support D-dimensional coordinates, but the return type is documented as array of shape (N, 2). Since the implementation at line 1722 uses np.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.

Comment thread src/skimage/feature/orb.py Resolved
Comment thread src/skimage/transform/_geometric.py Resolved

@lagru lagru left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good.

@mkcor
mkcor merged commit 9d61a84 into scikit-image:main Jan 19, 2026
@mkcor
mkcor deleted the docstub-fixes-VII branch January 19, 2026 17:10
FelipeCybis pushed a commit to FelipeCybis/scikit-image that referenced this pull request Jun 9, 2026
)

## 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧩 typing Type annotations, type checking, and stubs 🔧 type: Maintenance Refactoring and maintenance of internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants