Skip to content
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

DOCS: Numpydocs1 #5578

Merged
merged 12 commits into from Dec 4, 2023
Merged

DOCS: Numpydocs1 #5578

merged 12 commits into from Dec 4, 2023

Conversation

tkknight
Copy link
Contributor

@tkknight tkknight commented Nov 13, 2023

🚀 Pull Request

Description

Progressing numpydoc strings adoption, #4721.

Notes

  • I have ensure numpydoc style where possible by refactoring existing docstring, I have not labelled every single type etc, this is an improvement not a 100% perfect docstring.
  • Where appropriate I have added # noqa: D102 or # noqa: D102 (see error codes desc). This comment will skip the checks for the subsequent line.
  • A single line summary is needed on functions. I used the first part of the summary for this so there maybe a little duplication but I think that is ok
  • In lib/iris/fileformats/netcdf/saver.py there are a couple of very long links, these would render with a horizontal scroll which looks weird, so I used a text and a url instead.

pydocstyle test output

No errors/warnings raised. Commands used:

pydocstyle --convention=numpy --add-ignore=D105 ../lib/iris/config.py 
pydocstyle --convention=numpy --add-ignore=D105 ../lib/iris/fileformats/netcdf/__init__.py 
pydocstyle --convention=numpy --add-ignore=D105 ../lib/iris/fileformats/netcdf/_dask_locks.py 
pydocstyle --convention=numpy --add-ignore=D105 ../lib/iris/fileformats/netcdf/_thread_safe_nc.py 
pydocstyle --convention=numpy --add-ignore=D105 ../lib/iris/fileformats/netcdf/loader.py 
pydocstyle --convention=numpy --add-ignore=D105 ../lib/iris/fileformats/netcdf/saver.py 
pydocstyle --convention=numpy --add-ignore=D105 ../lib/iris/io/__init__.py 
pydocstyle --convention=numpy --add-ignore=D105 ../lib/iris/io/format_picker.py 
pydocstyle --convention=numpy --add-ignore=D105 ../lib/iris/time.py 

Links to current and new API docs

Note, some files are private so are not rendered in the docs.

  • current, new: lib/iris/config.py
  • current, new: lib/iris/fileformats/netcdf/__init__.py
  • lib/iris/fileformats/netcdf/_dask_locks.py
  • lib/iris/fileformats/netcdf/_thread_safe_nc.py
  • current, new: lib/iris/fileformats/netcdf/loader.py
  • current, new: lib/iris/fileformats/netcdf/saver.py
  • current, new: lib/iris/io/__init__.py
  • current, new: lib/iris/io/format_picker.py
  • current, new: lib/iris/time.py

Consult Iris pull request check list

* main:
  [pre-commit.ci] pre-commit autoupdate (SciTools#5579)
  Relicense to from LGPL-3 to BSD-3 (SciTools#5577)
  Allow `add_season_year()` to optionally send spans backwards (SciTools#5573)
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (54ad9be) 89.68% compared to head (0a47aa2) 89.68%.
Report is 2 commits behind head on main.

❗ Current head 0a47aa2 differs from pull request most recent head 10d4214. Consider uploading reports for the commit 10d4214 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5578   +/-   ##
=======================================
  Coverage   89.68%   89.68%           
=======================================
  Files          90       90           
  Lines       22818    22818           
  Branches     5446     5446           
=======================================
  Hits        20465    20465           
  Misses       1619     1619           
  Partials      734      734           

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

@tkknight tkknight mentioned this pull request Nov 14, 2023
91 tasks
@bjlittle bjlittle self-assigned this Nov 16, 2023
* upstream/main:
  Mergeback of `FEATURE_chunk_control` branch (SciTools#5588)
  [CI Bot] environment lockfiles auto-update (SciTools#5547)
  Mergeback of "Feature _split_attrs" branch (SciTools#5152)
  add whatsnew (SciTools#5596)
  Refactor area weighted regridding, improve performance (SciTools#5543)
  Allowing exemption to axis guessing on coords (SciTools#5551)
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 Awesome, thanks for taking this on and chipping away at it - it's so important to have compliance here and there are years of mixed styling in the iris docs 🙀

Only one question ... going forwards it would be good to be consistent with the spacing after the color and the variable when there is a type in the docstring i.e., var : type instead of var: type

I prefer spacing around the color, and the numpydoc states to have the spacing, although ruff doesn't enforce this (to my knowledge) although pydocstyle might (I've not checked) ... it would be ideal if this was an automated check going forwards though.

Otherwise LGTM (given your stated caveats, which I totally agree with) 👍

* 'numpydocs1' of github.com:tkknight/iris:
  Feedstock rc branch management in do-nothing script (SciTools#5515)
  Relocated the Technical Papers documentation to Further Topics.  (SciTools#5602)
  Fix pp save of realization coordinate (SciTools#5568)
  Bump actions/checkout from 3 to 4 (SciTools#5460)
  Bump actions/github-script from 6 to 7 (SciTools#5580)
  Bump conda-incubator/setup-miniconda from 2 to 3 (SciTools#5607)
  CI: specify matplotlib-base (SciTools#5606)
@tkknight
Copy link
Contributor Author

tkknight commented Dec 4, 2023

Review actions 506968f

@bjlittle bjlittle merged commit db43fde into SciTools:main Dec 4, 2023
16 checks passed
tkknight added a commit to tkknight/iris that referenced this pull request Dec 6, 2023
* main:
  DOCS: Numpydocs1 (SciTools#5578)
  add links to scitools-classroom repo. (SciTools#5609)
  Feedstock rc branch management in do-nothing script (SciTools#5515)
  Relocated the Technical Papers documentation to Further Topics.  (SciTools#5602)
  Fix pp save of realization coordinate (SciTools#5568)
  Bump actions/checkout from 3 to 4 (SciTools#5460)
  Bump actions/github-script from 6 to 7 (SciTools#5580)
  Bump conda-incubator/setup-miniconda from 2 to 3 (SciTools#5607)
  CI: specify matplotlib-base (SciTools#5606)
  Mergeback of `FEATURE_chunk_control` branch (SciTools#5588)
  [CI Bot] environment lockfiles auto-update (SciTools#5547)
  Mergeback of "Feature _split_attrs" branch (SciTools#5152)
  add whatsnew (SciTools#5596)
  Refactor area weighted regridding, improve performance (SciTools#5543)
  Allowing exemption to axis guessing on coords (SciTools#5551)
@tkknight tkknight deleted the numpydocs1 branch January 9, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants