-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Update ArrayEditor to correct deprecated Numpy operator #4667
Conversation
Changed numpy boolean subract operator '-' to np.logical_xor. As suggested in the numpy deprec warning. Tested locally with no error originally described in spyder-ide#4663
Is this backwards compatible? I mean, does it work with previous Numpy versions? |
And of course. thanks a lot for your contribution!! |
What about when the array loaded in the variable explorer does not have boolean entries? |
Sorry, didn't have a lot of time yesterday, but that wasn't a fix. This new edit calculates this scaling factor (max-value)/(max-min) with max as float each time. The issue only occurs for boolean with the deprecated minus operator but float of 0 or 1 minus value of 0 or 1 gives the same value for the scaling factor and was converted to float anyways in the next line. Tested with bool and non-bool array types and older numpy versions. |
@jitseniesen, do you approve this one? |
@GKosiba Looks good; but one detail: could you please add a short comment explaining why the conversion to |
@ccordoba12 @jitseniesen Comment added |
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.
Looks good to me. Thanks for your contribution.
Thanks @GKosiba for your contribution and @jitseniesen for reviewing it. This is going in! |
Fixes #4663.
Changed numpy boolean subract operator '-' to np.logical_xor. As suggested in the numpy deprec warning.
Tested locally with no error originally described in #4663