-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Test docstrings for parameters are equal #9388
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
Comments
I would like to work on this. Will try to get back with a PR in a few days. |
Go for it! No promises it's easy |
I need a clarification, Also, by default |
Exactly one of them should be set.
…On 13 December 2017 at 16:28, Aman Pratik ***@***.***> wrote:
I need a clarification,
What if include_params lists a few names and exclude_params is set to '*'?
Or vice-versa? Whom do we give priority?
Also, by default include_params is set to None so does that mean we don't
consider any parameter? Also, exclude_params is set to None at the same
time. It seems to be conflicting. May be we change default of either
include or exclude.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9388 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz65k39y1imdZoAW0tYp1OuVh_DRcPks5s_2CFgaJpZM4OZ-Op>
.
|
Regarding my second question, by default |
I don't think so, as we want to force the user to be explicit about either inclusion or exclusion |
We recently merged a test that checks consistency between parameters in function signatures and their docstrings using
sklearn.utils.testing.check_docstring_parameters
. I would like to have a function insklearn.utils.testing
which similarly makes use ofnumpydoc
to check that parts of docstrings are identical among a set of objects. I would expect this helper to eventually be contributed back to numpydoc.It might look something like:
Then we could call it with:
This will ensure (by making a test fail when the condition is not met) that all these related scoring functions have identical parameter descriptions (whitespace excepted) wherever they have identical parameters. (I've not actually checked whether this is or should be true of all these metric functions.) Most importantly, having such an assertion means we can rest assured that when we change the documentation of some parameter or return value, we will be forced to do so consistently.
The text was updated successfully, but these errors were encountered: