-
-
Notifications
You must be signed in to change notification settings - Fork 26k
MAINT Remove _arr
suffixes from _binary_tree
#25106
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
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.
LGTM modulo a few comments.
# Use cinit to initialize all arrays to empty: this will prevent memory | ||
# errors and seg-faults in rare cases where __init__ is not called |
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.
The suggestion for comments that I added previously can complete or be completed by this comment.
sklearn/neighbors/_binary_tree.pxi
Outdated
|
||
def __init__(self, n_pts, n_nbrs): | ||
self.distances_arr = np.full((n_pts, n_nbrs), np.inf, dtype=DTYPE, | ||
self.distances = np.full((n_pts, n_nbrs), np.inf, dtype=DTYPE, | ||
order='C') |
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.
Indentation is off. Let's use the black style for this line to avoid this kind of problems in the future.
Co-authored-by: Julien Jerphanion <[email protected]>
Co-authored-by: Julien Jerphanion <[email protected]>
a918b97
to
5744898
Compare
@ogrisel: I think this can be merged, what do you think? |
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 indeed. Thanks for the PR!
Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Olivier Grisel <[email protected]>
Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Olivier Grisel <[email protected]>
Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Olivier Grisel <[email protected]>
Reference Issues/PRs
Follows up #24965
Towards #24875
What does this implement/fix? Explain your changes.
data_arr
,sample_weight_arr
,idx_array_arr
,node_data_arr
, andnode_bounds_arr
now that we convert theircnp.array
counterparts to memoryviews directly._update_memviews
methodAny other comments?
#24965 needs to be merged first to shrink the number of changes on this PR