[WIP] DOC check warning raised by sphinx#20414
[WIP] DOC check warning raised by sphinx#20414glemaitre wants to merge 2 commits intoscikit-learn:mainfrom
Conversation
| ) | ||
| @property | ||
| def n_features_(self): | ||
| """int: The number of features seen during `fit`.""" |
There was a problem hiding this comment.
@thomasjpfan napoleon mentions that you can do the following for a property. Numpydoc raises an error because the summary does not start with a capital letter (since this is the type). However, it also mentioned that this is probably a property. So I assume this is kind of valid.
Do you have any thoughts on that?
There was a problem hiding this comment.
The following will work:
"""int : The number of features seen during `fit`.
"""
But black will reformat it on a single line ;P
There was a problem hiding this comment.
what is napoleon?
Edit: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/
There was a problem hiding this comment.
I agree with black: for oneliner docstrings, PEP257 says we should put the quotes on the same line.
There was a problem hiding this comment.
It should be possible to ignore GL02 by adding the following in conf.py:
numpydoc_validation_checks = {"all", "GL02"}https://numpydoc.readthedocs.io/en/latest/validation.html#docstring-validation-during-sphinx-build
There was a problem hiding this comment.
Basically, we want to ignore GL02 only in properties.
|
@glemaitre it seems that the new sphinx warnings will be fixed by #20410, right? I do not understand this PR. |
|
I am not sure what this PR is supposed to gix @glemaitre. In the failing CI I only see: which are unrelated and are now fixed in Could you please update the description to describe the problem with the error message you observe? |
Weird stuff with black as well.: Trailing spaces :)