-
Notifications
You must be signed in to change notification settings - Fork 19
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
Cleanup docstrings markups #227
Conversation
de6b9bd
to
f429679
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that cumbersome work!
I am only a bit worried that enforcing a linter without a formatter will be quite annoying. Did you manually format it or used some formatter as baseline? Referencing this issue #182
tox.ini
Outdated
ignore = | ||
E203 | ||
D100 | ||
D101 | ||
D102 | ||
D205 | ||
D400 | ||
D401 | ||
W503 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just assume this makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean a lot of them are very useless. You can take a look if you disagree with the ones I disabled.
The ones I disabled mean
D100 Missing docstring in public module
D101 Missing docstring in public class
D102 Missing docstring in public method
D205 1 blank line required between summary line and description
D400 First line should end with a period
D401 First line should be in imperative mood
Every Code that we remove from this list will require further changes to the docstrings.
E203 and W503 have to be disabled due to incompatibilities with black.
Everything is dine by Hand and most of the changes dictated by the linter. The things which are not catched and I changed are basically following the numpydoc which for us basiclally boils down to
this means I changed a docstring like this Parameters
----------
mixing: float, default=0.5
The PCovR mixing parameter, as described in PCovR as
:math:`{\\alpha}`
initialize: int or 'random', default=0
Index of the first selection. If 'random', picks a random
value when fit starts. to this Parameters
----------
mixing : float, default=0.5
The PCovR mixing parameter, as described in PCovR as :math:`{\\alpha}`
initialize : int or 'random', default=0
Index of the first selection. If 'random', picks a random value when fit starts. I agree that this is a bit unfortunate that there is no formatter for this but if we as reviewers know these rules One can easily comment in a PR. |
Replaced now @PicoCentauri could you have a look at my commits and merge if it is okay for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good to me. Thanks for further improvmenets @agoscinski
By replacing flake8 with ruff we can now automatically fix a lot of the linter errors with `ruff check --fix`. Added ignores for D410 D411, to get no additional linter errors.
`tox -e format-unsafe` allows to format unsafe that fixes more linter errors but might alter code logic.
With that we can expose the contributer to `tox -av` in the contributers guidelines.
While scrolling through the repository I found a lot of markup issues. They are not relevant for the rendered docs but triggered me a bit 🤣
I took the liberty to fix them and added a simple linter (
flake8-docstrings
) that will catch the very evil ones in the future.The codebase is smaller and wherever I found I replaced
ndarray
->numpy.ndarray
to have an intersphinx link to the Numpy docs.There is still a lot of space to imrprove the markup i.e. highlighting
variables
with double back ticks `` or using more intersphinx links in the docs. But lets keep it like this for now.📚 Documentation preview 📚: https://scikit-matter--227.org.readthedocs.build/en/227/