Skip to content

DOCS: Enable numpydoc validation pre-commit hook #5762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Feb 27, 2024

Conversation

tkknight
Copy link
Contributor

@tkknight tkknight commented Feb 20, 2024

🚀 Pull Request

Description

This pull-request enables the numpydoc pre-commit hook, which performs validation checks of all python docstrings to ensure that they comply with the numpydoc validation rules.

The check excludes:

  • lib/iris/tests/
  • docs/gallery_code/

The section [tool.numpydoc_validation] in pyproject.toml section defines all the rules to apply - which default to all with specific ignores that can be addressed over time.

This PR is based upon the GeoVista implementation bjlittle/geovista#716.

A new issue will be created to track the outstanding rules to address.


Consult Iris pull request check list

…umpydoc-pre-commit

* 'numpydoc-pre-commit' of github.com:tkknight/iris:
  Update CF standard names to v84. (SciTools#5761)
  Regrid docs fix (SciTools#5758)
  Improve ncdata and CF information on "iris heart xarray" page (SciTools#5752)
  Pin ASV - airspeed-velocity/asv#1385. (SciTools#5756)
  Normalise units of coordinate bounds (SciTools#5746)
  Add "Which Regridder?" Documentation (SciTools#5742)
  Document `Coord.ignore_axis` (SciTools#5744)
  Disable navidation with keys for docs HTML theme options (SciTools#5747)
  Shapefile masking (SciTools#5470)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5739)
  DOCS: Add whatsnew for ruff pydocstyle compliance (SciTools#5700)
  update docstring (SciTools#5737)
  Updated environment lockfiles (SciTools#5738)
  Consider NaNs equal when comparing cubes (SciTools#5713)
Copy link

codecov bot commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.74%. Comparing base (8998779) to head (d130b51).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5762   +/-   ##
=======================================
  Coverage   89.74%   89.74%           
=======================================
  Files          92       92           
  Lines       22940    22940           
  Branches     5462     5462           
=======================================
  Hits        20588    20588           
  Misses       1620     1620           
  Partials      732      732           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CLAassistant
Copy link

CLAassistant commented Feb 22, 2024

CLA assistant check
All committers have signed the CLA.

…umpydoc-pre-commit

* 'numpydoc-pre-commit' of github.com:tkknight/iris:
  Update documentation for the new v5 CLA. (SciTools#5664)
  Add an auto-labeller to always benchmark lock file changes (SciTools#5763)
@tkknight tkknight requested a review from bjlittle February 23, 2024 12:23
@tkknight tkknight marked this pull request as ready for review February 23, 2024 12:24
Copy link
Member

@bjlittle bjlittle left a comment

Choose a reason for hiding this comment

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

@tkknight Lovely pre-commit addition 🚀

This will ensure to add some rigor to the docstrings going forwards 🍻

@bjlittle bjlittle merged commit 6bc9adb into SciTools:main Feb 27, 2024
@bjlittle bjlittle self-assigned this Feb 27, 2024
tkknight added a commit to tkknight/iris that referenced this pull request Feb 27, 2024
* main:
  ASV custom build command and file-based benchmark triggers (SciTools#5776)
  DOCS: Enable numpydoc validation pre-commit hook (SciTools#5762)
  RUFF: fix legacy use of np.numpy.random (SciTools#5786)
stephenworsley pushed a commit to stephenworsley/iris that referenced this pull request Mar 11, 2024
* add numpdoc_validate to pre-commit

* wip

* wip

* wip

* fixed doctest errors.

* fox doctests.

* Update docs/src/further_topics/filtering_warnings.rst

Co-authored-by: Martin Yeo <[email protected]>

* numpydoc_validation to adhere to RT02 rule.

* sorted temp rules to ignore.

* numpydoc_validation to adhere to GL09 rule.

* numpydoc_validation to adhere to SA04 rule.

* fixed indent.

* fixed case and indentation.

* fix doctests.

* fix doctests (last time)

* add "See Also" colons

---------

Co-authored-by: Martin Yeo <[email protected]>
pp-mo pushed a commit to pp-mo/iris that referenced this pull request Mar 11, 2024
* add numpdoc_validate to pre-commit

* wip

* wip

* wip

* fixed doctest errors.

* fox doctests.

* Update docs/src/further_topics/filtering_warnings.rst

Co-authored-by: Martin Yeo <[email protected]>

* numpydoc_validation to adhere to RT02 rule.

* sorted temp rules to ignore.

* numpydoc_validation to adhere to GL09 rule.

* numpydoc_validation to adhere to SA04 rule.

* fixed indent.

* fixed case and indentation.

* fix doctests.

* fix doctests (last time)

* add "See Also" colons

---------

Co-authored-by: Martin Yeo <[email protected]>
pp-mo pushed a commit to pp-mo/iris that referenced this pull request Mar 11, 2024
* add numpdoc_validate to pre-commit

* wip

* wip

* wip

* fixed doctest errors.

* fox doctests.

* Update docs/src/further_topics/filtering_warnings.rst

Co-authored-by: Martin Yeo <[email protected]>

* numpydoc_validation to adhere to RT02 rule.

* sorted temp rules to ignore.

* numpydoc_validation to adhere to GL09 rule.

* numpydoc_validation to adhere to SA04 rule.

* fixed indent.

* fixed case and indentation.

* fix doctests.

* fix doctests (last time)

* add "See Also" colons

---------

Co-authored-by: Martin Yeo <[email protected]>
HGWright added a commit to HGWright/iris that referenced this pull request Mar 27, 2024
* 'geo-bridge' of github.com:HGWright/iris: (41 commits)
  Updated lock files.
  [pre-commit.ci] auto fixes from pre-commit.com hooks
  Advertise structured_um_loading performance regression.
  [pre-commit.ci] pre-commit autoupdate
  Updated environment lockfiles
  [pre-commit.ci] auto fixes from pre-commit.com hooks
  [pre-commit.ci] pre-commit autoupdate
  Make the bugfix panel OPEN.
  What's New patch.
  What's New patch.
  Bump scitools/workflows from 2024.03.1 to 2024.03.3
  Bump scitools/workflows from 2024.03.0 to 2024.03.1
  Bump scitools/workflows from 2024.02.2 to 2024.03.0
  Fix usage of map_blocks in AreaWeighted and elsewhere (SciTools#5767)
  Lazy rolling_window (SciTools#5775)
  whatsnew update for 3.8.0 (SciTools#5793)
  Bump scitools/workflows from 2024.02.1 to 2024.02.2 (SciTools#5792)
  DOCS: Add whatsnew for recent PRs (SciTools#5789)
  ASV custom build command and file-based benchmark triggers (SciTools#5776)
  DOCS: Enable numpydoc validation pre-commit hook (SciTools#5762)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants