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 Ensures that RadiusNeighborsClassifier passes numpydoc validation #20842
DOC Ensures that RadiusNeighborsClassifier passes numpydoc validation #20842
Conversation
@@ -437,7 +440,6 @@ def __init__( | |||
outlier_label=None, | |||
metric_params=None, | |||
n_jobs=None, | |||
**kwargs, |
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.
@ogrisel, We should go through a deprecation cycle here too, right?
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.
Indeed, this is a fix: beforehand, a user could pass an arbitrary parameter that would be discarded indeed.
We could remove kwargs
and consider it as a bug fix and it will force us to add a bug fix entry in the what's new.
Please add an entry to the change log at doc/whats_new/v*.rst
. Like the other entries there, please reference this pull request with :pr:
and credit yourself (and other contributors if applicable) with :user:
.
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 spoke with @ogrisel IRL, and it seems better to indeed deprecate kwargs
. So we still need an entry in what's new but this time it should announce the deprecation instead of the hard removal.
So what we need to do here is to check the length of kwargs
in __init__
and raise a FutureWarning
mentioning that the parameters are ignored and that in 1.2 (or 1.3 since we might merge after the release) an error will be raised instead of this warning.
We will also need a small test to check that we properly raise the warning.
We only need to add the what's new entry. The rest is fine.
Just a comment that the latest status on this PR is not the above approval but the comment in #20842 (comment) requesting to go through a deprecation cycle for kwargs removal. |
I just remove my approval to be sure that no one merges by mistake. Sorry about that.
Done. |
Reference Issues/PRs
Addresses #20308
What does this implement/fix? Explain your changes.
This PR ensures RadiusNeighborsClassifier is compatible with numpydoc.
RadiusNeighborsClassifier
fromDOCSTRING_IGNORE_LIST
.RemoveDeprecate unused parameterkwargs
fromRadiusNeighborsClassifier
.Any other comments?
Just to reiterate, note that the parameter
kwargs
wasremoveddeprecated from the__init__
method of RadiusNeighborsClassifier since it was not used.