-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT remove -Wsign-compare when compiling sklearn.utils.sparsefuncs_fast
#25244
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
MAINT remove -Wsign-compare when compiling sklearn.utils.sparsefuncs_fast
#25244
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.
Otherwise LGTM
sklearn/utils/sparsefuncs_fast.pyx
Outdated
unsigned long long col_ind | ||
integral row_ind | ||
integral i, row_ind | ||
unsigned long long k, col_ind |
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.
unsigned long long k, col_ind | |
unsigned long long feature_idx, col_ind |
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.
Thank you, @Vincent-Maladiere!
I do not observe such -Wsign-compare
warnings for this compilation unit with my compiler (gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
). Are you using LLVM via clang
?
I appreciate the renaming of k
for feature_idx
which is a more informative. Yet, I think it extends the scope of this PR and makes the diff harder to read with respect to the change of logic (which is be small and should rather be transparent). Moreover, I think this renaming is partial here and might preferably be done once entirely.
Hence would prefer having this renaming be done in another dedicated MAINT
pull request.
What do you think?
Apart from those two remarks, this contribution LGTM.
Hi @jjerphan, thank you for the review! Yes, I'm using LLVM via |
I would not do that. We already change the name of the variable from Note that I limit the proposal to changing the variable only to the already modified variable. |
I think that this renaming is out of the scope of this PR and makes the implementation of the intend harder to understand. What do you think? |
I still think that you are renaming |
Ah, I was mentioning the renaming of |
I think you're not on the same page :) |
I also agree. To clarify the situation, I initially added the variable |
#25244 (comment) is the comment I have not understood: previously there was a renaming of
That's what I understood, and I think we should not do renaming at all. Anyway, I let @glemaitre when this LGTH, I do not want to bikeshed too much and block the removal of warnings. |
Merging because @glemaitre and I agree on the current state. Thanks, @Vincent-Maladiere. |
Reference Issues/PRs
Towards #24875
Useful reads: #9663, #24426 (comment)
What does this implement/fix? Explain your changes.
Replace some indices types with their range value type.
Any other comments?
Remove 41
-Wsign-compare
warnings :)