-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[WIP] DOC check warning raised by sphinx #20414
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
Conversation
@@ -1021,6 +1021,7 @@ def predict_log_proba(self, X): | |||
) | |||
@property | |||
def n_features_(self): | |||
"""int: The number of features seen during `fit`.""" |
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is napoleon
?
Edit: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/
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 agree with black: for oneliner docstrings, PEP257 says we should put the quotes on the same line.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :)