Skip to content

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

Merged
merged 3 commits into from
May 2, 2022

Conversation

thomasjpfan
Copy link
Member

@thomasjpfan thomasjpfan commented Apr 28, 2022

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

Copy link
Member Author

@thomasjpfan thomasjpfan left a 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
Copy link
Member Author

@thomasjpfan thomasjpfan Apr 29, 2022

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.

Copy link
Member

@jjerphan jjerphan left a 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.

Copy link
Member

@lesteve lesteve left a 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

thomasjpfan and others added 2 commits April 29, 2022 11:41
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
@jeremiedbb jeremiedbb merged commit 736b051 into scikit-learn:main May 2, 2022
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Aug 4, 2022
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
glemaitre added a commit that referenced this pull request Aug 5, 2022
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants