Enable numpydoc validation - #23439
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughRetains Numpydoc validation settings while removing explanatory configuration comments. Expands and normalizes documentation for the cuDF options module and selected public APIs without changing behavior. ChangesNumpydoc validation rollout
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@PROGRESS.md`:
- Line 10: Refresh the progress journal metadata to reflect the current pull
request state, including that the pull request has been opened if applicable,
the complete changed-file count including python/cudf/cudf/options.py and the
Phase III journal update, and an accurate “What’s Next” section. If preserving
the existing values, clearly label the status, counts, and next steps as a
historical snapshot.
In `@python/cudf/cudf/options.py`:
- Around line 355-359: The option_context docstring uses inconsistent invocation
syntax. Update the preceding usage description in option_context to show the
flat alternating name/value form, matching the *args description and example,
and remove the outdated tuple-list form that implies an invalid argument count.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 8bf74f25-0558-4c1b-9c0f-2a27da6d6b88
📒 Files selected for processing (4)
.pre-commit-config.yamlPROGRESS.mdpython/cudf/cudf/options.pypython/cudf/pyproject.toml
…ai#11253) Wire up the numpydoc-validation pre-commit hook (numpy/numpydoc v1.9.0) for cuDF's public Python API. The package is not yet docstring-clean (~4,143 pre-existing violations across 154 of 155 files), so enabling a repo-wide gate would break CI immediately. Instead, enforce validation on an explicit allowlist of files that already pass, to be grown one PR at a time so CI stays green throughout the rollout. - .pre-commit-config.yaml: add the hook, scoped to a 10-file allowlist. - python/cudf/pyproject.toml: add [tool.numpydoc_validation]; enable all semantic checks, deselect optional/stylistic ones, and exclude protocol dunders and module-private helpers (validation targets the public API). - python/cudf/cudf/options.py: fix genuine docstring bugs so the module passes validation. get_option documented a nonexistent `key` parameter instead of `name` and had no return description; describe_option's summary used "Prints" instead of the infinitive "Print"; option_context did not document *args and showed an invalid invocation form. Also document the module and Option dataclass. Docstring-only; no behavior change.
e1fbb36 to
9b29a3f
Compare
|
Thanks for the review! I've pushed revisions addressing the feedback:
Quick summary for reviewers: this enables numpydoc validation on an explicit allowlist of 10 already-compliant files (rather than the whole package, which still has ~4,143 pre-existing violations), so CI stays green while the allowlist grows one PR at a time. This is a non-breaking improvement / docs change — could a maintainer add the |
| # See https://numpydoc.readthedocs.io/en/latest/validation.html for the full | ||
| # list of check codes. We enable all semantic checks and disable only the | ||
| # optional/stylistic ones below. Remaining violations are cleaned up | ||
| # incrementally, a few check codes at a time (see cuDF issue #11253). |
There was a problem hiding this comment.
| # See https://numpydoc.readthedocs.io/en/latest/validation.html for the full | |
| # list of check codes. We enable all semantic checks and disable only the | |
| # optional/stylistic ones below. Remaining violations are cleaned up | |
| # incrementally, a few check codes at a time (see cuDF issue #11253). |
| # Validation is configured under [tool.numpydoc_validation] in | ||
| # python/cudf/pyproject.toml. The whole cudf package is not yet | ||
| # docstring-clean, so we enforce validation on an explicit allowlist of | ||
| # already-compliant files and grow it incrementally, one PR at a time, | ||
| # keeping CI green throughout (see cuDF issue #11253). |
There was a problem hiding this comment.
| # Validation is configured under [tool.numpydoc_validation] in | |
| # python/cudf/pyproject.toml. The whole cudf package is not yet | |
| # docstring-clean, so we enforce validation on an explicit allowlist of | |
| # already-compliant files and grow it incrementally, one PR at a time, | |
| # keeping CI green throughout (see cuDF issue #11253). |
| # docstring-clean, so we enforce validation on an explicit allowlist of | ||
| # already-compliant files and grow it incrementally, one PR at a time, | ||
| # keeping CI green throughout (see cuDF issue #11253). | ||
| files: | |
There was a problem hiding this comment.
Can we specify files to exclude instead?
| "SA04", # description in see also not required | ||
| "SS06", # allow summaries that span more than a single line | ||
| ] | ||
| # Skip objects that do not benefit from full docstring validation. |
There was a problem hiding this comment.
| # Skip objects that do not benefit from full docstring validation. |
|
Thanks! I looked into exclude_files from that page — two findings:
So the files: allowlist is the smaller, more readable list today and grows one PR at a time as modules are cleaned. Once most of the package passes, I'm happy to flip it — bump numpydoc and switch to exclude_files so new files are validated by default. Keep the allowlist for now, or go the bump + exclude_files route? |
|
I suggest to bump the numpydoc version to specify exclusions instead, as it will be easier to know what needs correcting in the future. |
Description
closes #11253
Checklist