-
Notifications
You must be signed in to change notification settings - Fork 671
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
[DOC] Fix Linting issue and update docstring to Numpy Style By Module #1749
Comments
If existing codebase followsgoogle style, can we not continue that? It can be configured easily I think. https://docs.astral.sh/ruff/settings/#lint_pydocstyle_convention |
I would prefer the numpy style, as the implementations seem to be more detailed, and the numpy style works well for the case. https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html Otherwise, we would need to increase the length of the line in our linter because the google style uses indentation whereas numpy uses underlines. Google would be the best choice for short docstring, but for docstring where we need |
…in linting rules see #1749 (#1748) ### Description This PR fixes the linting errors after the lint rules were updated recently. Initially added a lot of `noqa` to have a baseline that passes the lint check going to work on removing all `noqa` to the minimal value. This is still a work in progress. This temporary fix is for allowing PRs to be in mergeable states given that they pass code quality checks. The exhaustive refactoring is being done in #1749 to ensure the code quality.
I'll argue that if a package has used a format consistently throughout its development so far, and especially a format that is a well enough standard (e.g. fully supported by napoleon), it does bot make sense to me to change everywhere in so many modules. I prefer numpy style myself, but not in a case that will create a hyge huge PR for zero functional difference. AFAIK all docstring styles allow breaking into multiple lines, I don't think line length limit is a hard one to manage. That said, if historically this project has followed a different linter, e.g. pylint uses 99 instead of 88 by black, I see no reason to break that consistency. It doesn't affect developers at all, since it'll be take care of by pre-commit and pyproject.toml together. |
@yarnabrina, I would agree with you if the project would have had good linting/docs historically, but that is not the case. It's a great project, but its devs did not quite focus of professional documentation. As the context for my opinion:
My argument would be, if we have to rewrite most of the docstrings anyway, let's do it in numpy style. In this matter, I would be with @fnhirwa and vote in favour, if my opinion does not change. |
And if we break it into sub-commits we can track the changes through submodule refactoring. |
I understand your point of view, |
@yarnabrina, up to you, let us know if you would like us to start one and ping core devs. I am noting that this PR - which made the changes - was open for one week (one week before the latest notes in this discussion), so you would have had to raise a blocking change request there: #1748 However, we have not released it yet, so I would be ok extending the period and re-discuss - alternatively, formally, you can revert and we can vote on the revert. |
@fnhirwa didn't add the docstring changes in #1748 as far as I can see, only placed noqa placeholders. I am okay with that PR and it needs no revert from my point of view. I remember a post on Discord about discussion on this some Friday, so I assume every core dev or mentee or council prefers numpy except me. So a formal vote looks unnecessary, but we can request them to share their opinion (and why) if you prefer to close this in a formal way. |
Describe the issue linked to the documentation
This is an issue for tracking the fixation of linting errors in the codebase and updating the docstring to the proper numpy style:
From
To
Suggest a potential alternative/fix
Subsetting the issue as the changes are expected to be huge for review.
The text was updated successfully, but these errors were encountered: