DOCS: Adopt the numpydoc validation rules

Open
#5,780 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
documentation

Research direction

Start with the [tool.numpydoc_validation] section in pyproject.toml and review the listed GL08, PR01, PR02, PR04, PR07, RT01, and RT03 rules. Uncomment each rule in turn and run pre-commit run --all-files to inspect the reported errors. Done means the outstanding rules have been reviewed and adopted where possible, with only necessary exceptions remaining.

Written by the indexing model from the issue text.

Description

Type: Documentation

📚 Documentation

The pre-commit hook to check these rules was added in https://github.com/SciTools/iris/pull/5762.

The outstanding rules review and ideally adoption are below as defined in pyproject.toml (section [tool.numpydoc_validation]). There is an option to keep them ignored only it absolutely needed.

  • GL08 The object does not have a docstring : 1320 errors
  • PR01 Parameters ... not documented : 951 errors
  • PR02 Unknown parameters {....} - 74 errors
  • PR04 Parameter "...." has no type : 407 errors
  • PR07 Parameter "...." has no description : 47 errors
  • RT01 No Returns section found : 609 errors
  • RT03 Return value has no description : 219 errors

To test these rules just comment out one at a time and then run the pre-commit locally via pre-commit run --all-files.

For more information see https://numpydoc.readthedocs.io/en/latest/validation.html.

See also #5625 ruff: incremental adoption.

Dominant language
Python
Stars
724
Forks
317
Avg merge
3d 20h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SciTools/iris

All issues in SciTools/iris

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.