Skip to content

Fix invalid syntax 2-D array: docstub fixes (IV).#8023

Merged
lagru merged 10 commits intoscikit-image:mainfrom
mkcor:docstub-fixes-IV
Jan 18, 2026
Merged

Fix invalid syntax 2-D array: docstub fixes (IV).#8023
lagru merged 10 commits intoscikit-image:mainfrom
mkcor:docstub-fixes-IV

Conversation

@mkcor
Copy link
Copy Markdown
Member

@mkcor mkcor commented Jan 15, 2026

Description

This PR is orthogonal to #8014.

Edit: Here I have addressed the last item in the list of errors that docstub spits out. The last item in the list is a group of warnings.

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 docstring type annotations across multiple image-processing functions to more precisely specify expected input/output shapes, dtypes, and return formats.
  • Chores
    • Tightened an automated typing workflow threshold (minor adjustment) to refine project checks.

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

@mkcor mkcor added 🔧 type: Maintenance Refactoring and maintenance of internals 🧩 typing Type annotations, type checking, and stubs labels Jan 15, 2026
Copy link
Copy Markdown
Member

@stefanv stefanv left a comment

Choose a reason for hiding this comment

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

This looks good to me. We have to resolve the "2-D ndarray" issue, and the "same dtype is input image" spelling.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

Reduced the docstub allowed-errors threshold in the typing CI workflow and updated multiple docstrings to use explicit ndarray shape/dtype descriptions and to document masks as tuples of pixel coordinates; no functional or API signature changes.

Changes

Cohort / File(s) Summary
CI typing workflow
/.github/workflows/typing.yml
Adjusted the docstub invocation: --allow-errors lowered from 895 to 848. No other workflow flags or control flow changed.
Docstring — random shapes masks
src/skimage/draw/_random_shapes.py
Updated Returns documentation: indicesmask : tuple described as a tuple of pixel coordinates for generated shapes; documentation-only.
Docstring — edge filters
src/skimage/filters/edges.py
Replaced generic "2-D array" descriptions with ndarray of shape (M, N) and clarified outputs as ndarray of shape (M, N) and dtype float; documentation-only.
Docstring — rank percentile filters
src/skimage/filters/rank/_percentile.py
Clarified parameter and return docstrings to use ndarray with explicit shapes/dtypes for image, footprint, and out arguments; documentation-only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐇 I hopped through lines of doc and code,

Tuned a number, smoothed a mode.
Masks now speak as tuples true,
Shapes and dtypes clearer too.
A tiny nibble, tidy and bold.

🚥 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 accurately reflects the main changes: updating docstrings across multiple files to fix docstub validation issues related to 2-D array syntax and documentation improvements.
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 and others added 4 commits January 16, 2026 17:29
The order and type in the Return section didn't match the implementation
this should improve the situation.
Co-authored-by: Marianne Corvellec <marianne.corvellec@ens-lyon.org>
Copy link
Copy Markdown
Member

@lagru lagru left a comment

Choose a reason for hiding this comment

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

Looks good.

Copy link
Copy Markdown
Member Author

@mkcor mkcor left a comment

Choose a reason for hiding this comment

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

Thanks for the thorough enough review, @lagru! 🙏

lagru and others added 3 commits January 18, 2026 12:32
Co-authored-by: Marianne Corvellec <marianne.corvellec@ens-lyon.org>
# Conflicts:
#	.github/workflows/typing.yml
@lagru lagru merged commit d2e0b89 into scikit-image:main Jan 18, 2026
23 of 25 checks passed
@stefanv stefanv added this to the 0.27 milestone Jan 18, 2026
@mkcor mkcor deleted the docstub-fixes-IV branch January 18, 2026 14:47
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.

3 participants