Skip to content

Adopt sphinx-apidoc and retire complex sphinxext #5264

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 8 commits into from
Apr 25, 2023

Conversation

tkknight
Copy link
Contributor

🚀 Pull Request

Description

Retire the old and convoluted sphinx extensions to generate the Iris API documentation.

  • Uses sphinx-apidoc instead
  • The indented blank line is now gone that appeared at the top of some API doc pages
  • The "In this module:" section is now not present (part of the old extensions), this is fine as the right hand sidebar shows this now.
  • At the bottom of each page the TOC (Table of contents) for all child packages or modules is displayed. I think this is useful, especially if viewing on a smaller screen where the sidebar may be hidden.
  • The order or sidebar contents are different but all are present
  • The docstrings can be in a slightly different place but all are present I believe (I welcome someone doing a review to check some api doc pages)
  • There is still a sphinxext (new one) that will remove the word package and module that make the sidebar hard to read imho. I cannot find any option in sphinx-apidoc itself to disable this.
    • Without package and module in the sidebar (and headings)
      • image
    • With package and module in the sidebar (and headings)
      • package and module in the sidebar (and headings)
        • image

There are many incorrect indentations and incorrect syntax in the docstrings that should be using the numpydocs, I may address those in a separate PR.


Consult Iris pull request check list

@trexfeathers
Copy link
Contributor

OMG ❤

@codecov
Copy link

codecov bot commented Apr 20, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (cb287ce) 89.32% compared to head (f0dce12) 89.32%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5264   +/-   ##
=======================================
  Coverage   89.32%   89.32%           
=======================================
  Files          89       89           
  Lines       22390    22390           
  Branches     5374     5374           
=======================================
  Hits        20000    20000           
  Misses       1640     1640           
  Partials      750      750           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bjlittle bjlittle self-requested a review April 20, 2023 16:11
@rcomer
Copy link
Member

rcomer commented Apr 20, 2023

😍

Think the linkcheck failure is matplotlib/matplotlib#25731

@bjlittle
Copy link
Member

heart_eyes

Think the linkcheck failure is matplotlib/matplotlib#25731

There been a server outage for the mpl docs most of the afternoon, but it's back up now.

I respun the CI and all is well now 😄

* upstream/main:
  Updated environment lockfiles (SciTools#5270)
  Drop python3.8 support (SciTools#5269)
  build wheel from sdist, not src (SciTools#5266)
  Lazy netcdf saves (SciTools#5191)
  move setup.cfg to pyproject.toml (SciTools#5262)
  Support Python 3.11 (SciTools#5226)
  Remove Resolve test workaround (SciTools#5267)
  add missing whatsnew entry (SciTools#5265)
@tkknight tkknight marked this pull request as ready for review April 22, 2023 16:49
@bjlittle bjlittle self-assigned this Apr 24, 2023
Copy link
Member

@pp-mo pp-mo left a comment

Choose a reason for hiding this comment

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

Don't usually comment on docs PRs, but this one is a great improvement !
It all looks great to me -- couldn't see anything wrong + all the changes are beneficial.
🚀

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 This is fantastic! 🥇

I've been waiting for us to purge the custom extensions for many years... that said, they've served their purpose very well indeed.

Since #5274 landed, which also changed the lock files, could you please rebase your PR and re-generate the lock files with your new sphinxcontrib-apidoc dependency.

Awesome thanks 👍

* upstream/main:
  Two negating pins for dependencies - libnetcdf and numpy (SciTools#5274)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5275)
  updated installing instructions to use pip (SciTools#5273)
  remove sphinx-panel config as now longer needed (SciTools#5272)
@bjlittle bjlittle merged commit 41bf7a0 into SciTools:main Apr 25, 2023
tkknight added a commit to tkknight/iris that referenced this pull request Apr 26, 2023
* upstream/main:
  Adopt sphinx-apidoc and retire complex sphinxext (SciTools#5264)
  Two negating pins for dependencies - libnetcdf and numpy (SciTools#5274)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5275)
@@ -154,7 +154,7 @@ https://conda.anaconda.org/conda-forge/noarch/locket-1.0.0-pyhd8ed1ab_0.tar.bz2#
https://conda.anaconda.org/conda-forge/linux-64/markupsafe-2.1.2-py39h72bdee0_0.conda#35514f5320206df9f4661c138c02e1c1
https://conda.anaconda.org/conda-forge/linux-64/msgpack-python-1.0.5-py39h4b4f3f3_0.conda#413374bab5022a5199c5dd89aef75df5
https://conda.anaconda.org/conda-forge/noarch/munkres-1.1.4-pyh9f0ad1d_0.tar.bz2#2ba8498c1018c1e9c61eb99b973dfe19
https://conda.anaconda.org/conda-forge/linux-64/numpy-1.24.2-py39h7360e5f_0.conda#757070dc7cc33003254888808cd34f1e
https://conda.anaconda.org/conda-forge/linux-64/numpy-1.23.5-py39h3d75532_0.conda#ea5d332e361eb72c2593cf79559bc0ec
Copy link
Member

Choose a reason for hiding this comment

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

note: same in all 3 lockfiles ?

@tkknight tkknight deleted the apidoc_improvements branch November 9, 2023 15:48
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.

5 participants