-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MNT Refactor splitter flow by removing indentation #23237
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
MNT Refactor splitter flow by removing indentation #23237
Conversation
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.
Maybe @adrinjalali would be interested in this. It's a non-functional change. (I'm trying to get a to point where missing values for trees is easier to introduce).
@@ -345,75 +345,77 @@ cdef class BestSplitter(BaseDenseSplitter): | |||
features[n_drawn_constants], features[f_j] = features[f_j], features[n_drawn_constants] | |||
|
|||
n_drawn_constants += 1 | |||
continue |
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.
Most of this PR is adding continue
in a few places, so there is less indentations from the else
clause.
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.
LGTM. Thank you, @thomasjpfan.
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.
LGTM, it may help (although sometimes diff is a bit weird) to look at the diff hiding white space:
https://github.com/scikit-learn/scikit-learn/pull/23237/files?w=1
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Reference Issues/PRs
This PR is continues my other PRs for tree refactoring. (#22328, #22921, #22868)
What does this implement/fix? Explain your changes.
There is no functional change here. I think having less indentations makes the code over all easier to follow.
CC @jjerphan @glemaitre