MNT (SLEP6) remove other_params from provess_routing#26909
Merged
thomasjpfan merged 4 commits intoscikit-learn:mainfrom Jul 27, 2023
Merged
MNT (SLEP6) remove other_params from provess_routing#26909thomasjpfan merged 4 commits intoscikit-learn:mainfrom
thomasjpfan merged 4 commits intoscikit-learn:mainfrom
Conversation
thomasjpfan
reviewed
Jul 26, 2023
Member
thomasjpfan
left a comment
There was a problem hiding this comment.
During my initial SLEP006 review, I have found other_params a bit weird. I am happy with this change.
Does all the calls in process_routing in examples/miscellaneous/plot_metadata_routing.py need to change too?
|
|
||
|
|
||
| def process_routing(obj, method, other_params, **kwargs): | ||
| def process_routing(_obj, _method, /, **kwargs): |
Member
There was a problem hiding this comment.
Given that this is not the norm, may you add a comment here that explains the purpose of _obj and _method based on #26909 (comment) ?
Member
Author
|
Nice hint with the example usage, fixed. |
OmarManzoor
approved these changes
Jul 27, 2023
Contributor
OmarManzoor
left a comment
There was a problem hiding this comment.
Looks good. Thanks @adrinjalali
punndcoder28
pushed a commit
to punndcoder28/scikit-learn
that referenced
this pull request
Jul 29, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the
other_paramsfromprocess_routing, since they can be passed as**kwarganyway. There used to be some difference between args passed explicitly and the ones passed as kwargs to methods such asfit, but later with the introduction of a more richMetadataRouterthe need for that distinction was removed.This also renames
objto_objandmethodto_methodas arguments and makes them positional only. This also reflects quite a bit from Python's API. The rename helps with avoiding collisions between metadata andobjandmethodas metadata names.cc @thomasjpfan @OmarManzoor