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

Numpydoc Compliance #1988

Merged
merged 40 commits into from
Dec 10, 2024
Merged

Numpydoc Compliance #1988

merged 40 commits into from
Dec 10, 2024

Conversation

Zeitsperre
Copy link
Collaborator

@Zeitsperre Zeitsperre commented Nov 8, 2024

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes #xyz
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGELOG.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • Integrates the numpydoc library for docstring validation.
  • Fixes the codespell configuration (previously was not parsing all relevant files).
  • Drops Python3.9 coding conventions everywhere.
  • Reformats existing docstrings using \* to use * instead.
    • On a related note, disabled flake8's RST210 and RST213 checks that were flagging * symbols in docstrings as unterminated emphasis and strong tags.
  • Adds a step to the Indictor.parse_indice that sanitizes the * symbols from Parameters entries.
  • Painstakingly modifies all docstrings to be closer to the numpydoc specification.

Does this PR introduce a breaking change?

It should not. Call signatures and docstrings will be slightly changed.

Other information:

https://numpydoc.readthedocs.io/en/latest/validation.html

Except for the custom fields that we use to populate our documentation, the docstrings of xclim are very consistent and virtually compliant with the standard now.

Both xclim.sdba and xclim.core.missing are not evaluated by numpydoc due to major refactoring efforts that are underway (https://github.com/Ouranosinc/xsdba) or needed (#2000).

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions bot added sdba Issues concerning the sdba submodule. CI Automation and Contiunous Integration docs Improvements to documenation indicators Climate indices and indicators labels Nov 8, 2024
@github-actions github-actions bot added the API Interfacing and User Concerns label Nov 11, 2024
@Zeitsperre Zeitsperre added this to the v0.54.0 milestone Nov 12, 2024
@Zeitsperre Zeitsperre marked this pull request as ready for review November 19, 2024 21:58
@Zeitsperre Zeitsperre self-assigned this Nov 22, 2024
Copy link
Contributor

@coxipi coxipi left a comment

Choose a reason for hiding this comment

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

Nice work! Following my comments you might want or not to change conventions, I can check again later

pyproject.toml Outdated Show resolved Hide resolved
tests/test_sdba/test_adjustment.py Show resolved Hide resolved
xclim/analog.py Outdated Show resolved Hide resolved
xclim/core/calendar.py Show resolved Hide resolved
xclim/core/datachecks.py Outdated Show resolved Hide resolved
xclim/core/units.py Show resolved Hide resolved
xclim/ensembles/_robustness.py Outdated Show resolved Hide resolved
xclim/indices/generic.py Show resolved Hide resolved
xclim/indices/generic.py Outdated Show resolved Hide resolved
xclim/testing/utils.py Show resolved Hide resolved
@github-actions github-actions bot added the approved Approved for additional tests label Nov 25, 2024
Copy link

Note

It appears that this Pull Request modifies the main.yml workflow.

On inspection, the XCLIM_TESTDATA_BRANCH environment variable is set to the most recent tag (v2024.8.23).

No further action is required.

@Zeitsperre
Copy link
Collaborator Author

@coxipi I just want to update the CHANGELOG one last time, but otherwise, this PR is simply waiting on the fix to support the latest xarray.

Thanks again for your comments!

@Zeitsperre Zeitsperre merged commit 1fc733d into main Dec 10, 2024
21 checks passed
@Zeitsperre Zeitsperre deleted the numpydoc branch December 10, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Interfacing and User Concerns approved Approved for additional tests CI Automation and Contiunous Integration docs Improvements to documenation indicators Climate indices and indicators sdba Issues concerning the sdba submodule.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants