-
Notifications
You must be signed in to change notification settings - Fork 283
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
numpydoc adoption tick list #4721
Comments
An opportunity to also tick off #3292? |
Ticking off one or more boxes would be a good activity for someone new to making Iris contributions. Here's how you can test your changes: Contributing to the Documentation |
Can we adopt pydocstyle for conformance, at least once we have completed the transition ? I think we can use this both as a pre-commit hook for developers -- which we can implement at once. |
@pp-mo For me, the answer to your question is "yes" and "no". See here. Personally, I think we should adopt I've already talked to @tkknight about this offline, and he's keen to leverage on-going compliance with |
Well I think that's effectively the same tech under the hood, so how we do it is another discussion, specifically #5254 The main problem as I see it is the effort to get everything "passing" in the first place. I'm just wondering if it's better to do that as a specific project rather than waiting for it to happen piecemeal. |
Personally, I prefer piecemeal. It's more palatable IMHO. Anyways, that's how I'm proceeding with this. And yes, the goal is for |
All files have now been reviewed and updated to ensure they are valid numpydocs. All future PRs should take the opportunity to improve the docstrings (adding/improving the Parameters section, etc). This is part of the PR checklist (step 6). #5625 continues the journey for full adoption of ruff. |
📚 Documentation
GOAL: Improve the docstring content and ensure numpydocs formatting.
Related to #5637.
Below is a list of all the python files in
iris/lib
. In order to make ground ensuring our code based support numpdoc fully the below checklist can be used to track our progress.Recommend we slowly work thru this list using multiple pull requests, all may contribute!
For each file we should:
How to Test usinf ruff (preferred)
Install ruff into your iris-dev conda environment via:
pip install ruff
Temporarily enable the ruff checker by commenting out this line: https://github.com/SciTools/iris/blob/main/.ruff.toml#L30 Once all the repo the source is compliant this ignore rule can be removed.
You can then run the checker via (running against
time.py
in this example):ruff time.py
How to Test (not preferred)
Unless we find something better we can use pydocstyle. Install into your iris-dev conda environment via:
pip install pydocstyle
You can then run the docstring checker via (running against
time.py
in this example):pydocstyle --convention=numpy --add-ignore=D105 time.py
We can use the numpy convention otherwise there maybe conflicts in the errors codes (fix one and and the other triggers and vice versa).
Proposed additional error codes to ignore:
D105
- Missing docstring in magic methodHit List
Commands used to create the list:
cd lib/iris; find . -name "*.py" -print | grep -v "^./tests"
. Feel free to remove entries is they are not relevant.pearsonr
to useResolve
#5638, DOCS: numpydocs 5 #5715)./std_names.pypython setup.py std_names
and on build/install.The text was updated successfully, but these errors were encountered: