-
-
Notifications
You must be signed in to change notification settings - Fork 26k
FIX fix comparison between array-like parameters when detecting non-default params for HTML representation #31528
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
Instead of wrapping it in a try except, we could use
which should work because |
Please also add a non regression test and a changelog entry. You can reuse the snippet from the issue. |
We probably want to do that only if one of the two parameters is an array-like. Otherwise, we want to use the Python comparison for scalars.
I'm wondering if we could strengthen the non-regression test by checking different combination of parameters (int, float, bool, array-like, ndarray, etc.). |
This reverts commit 4556bf2.
Thank you both @jeremiedbb and @glemaitre If a default parameter is |
I'm okay to show it as the same because we don't have a way to differentiate for scalar values anyway (since we're not using sentinels for default values, but we're not going to do that).
Why only for array-likes ? it also works for scalar values being any kind of object. |
Do you want to call |
@glemaitre @jeremiedbb |
RideCV
diagram representation with non-default alphas
Yes because it works (at least for our use cases as far as I can tell) with a single condition :) |
I added a couple of cases: 2 different size arrays, and one int vs float. Also removed the the |
Have you considered using hypothesis to test/find edge cases? I mean in general, in the past. I don't mean it should be used now. It's quite good to find them, as you might know. |
There is a discussion that have been started here: #13846 |
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 on my side.
I added the PR into the 1.7.1 milestone. Thanks @DeaMariaLeon |
We special case |
Reference Issues/PRs
Fixes #31525
What does this implement/fix? Explain your changes.
As @glemaitre commented, we were comparing 2 different-size arrays:
param_value != init_default_params[param_name]
Any other comments?
😱