-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix GH14900: numpy 1.17.0 breaks test_colors. #14901
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
Fix GH14900: numpy 1.17.0 breaks test_colors. #14901
Conversation
Looks good. Were we ignoring an API change warning on this? |
Is there a reason codecov didn’t trigger for this PR? |
@jklymak Thanks for the reviewing! But I don't quite follow your two comments here: API change warning? and codecov didn't trigger? 😝What are they means? |
We have a codecoverage check called codecov that makes sure your change is actually tested. Numpy obviously changed their API. If we weren’t getting deprecation notices they may have changed this inadvertently and it should be reported to them. |
I'm going to merge this because it un-breaks the build. Thanks @bingyao for the fix and for reporting it upstream! |
…901-on-v3.1.x Backport PR #14901 on branch v3.1.x (Fix GH14900: numpy 1.17.0 breaks test_colors.)
The change in numpy was indeed an accident, and will hopefully restore the correct behavior in 1.17.1. I don't know if you want to do a version-check here for just the broken release, and keep the more memory-efficient out argument otherwise? |
…901-on-v2.2.x Backport PR #14901 on branch v2.2.x (Fix GH14900: numpy 1.17.0 breaks test_colors.)
PR Summary
Try to fix #14900
Part I
In the original file(
colors.py
), the following lines should be (functionally) equivalent:Although I know the
ufunc
's output argument can save memory, but I don't quite understand why the original file used A instead of B? (whether was a misusage or there is some advantage?)Part II
Everything was fine until Numpy 1.17.0 where
np.clip
breaks the equivalence withMaskedArray
:I also opened an issue in numpy's repo: numpy/numpy#14140