-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
less_simple_linear_interpolation can be replaced by np.interp. #9865
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
Tiny image error on the mac: I don't have time right now, but could try to see what the difference is later tonight. |
that'd be very helpful, thanks |
The image error is:
If I look at the diff image, I can't see where the difference is, and the images look fine. I'd suggest raising the tolerance for this one. |
d1f565f
to
db1bbd6
Compare
We're probably running into some 32-vs-64 bit rounding error that's a bit bigger for interp; that test actually already had a nonzero tolerance so I feel comfortable increasing it a bit. |
lib/matplotlib/contour.py
Outdated
@@ -289,6 +289,7 @@ def get_label_width(self, lev, fmt, fsize): | |||
|
|||
return lw | |||
|
|||
@cbook.deprecated("2.2") |
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.
This seems unrelated. Can you remove it or add an API changes doc?
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.
moved to its own PR
@@ -3404,6 +3404,7 @@ def griddata(x, y, z, xi, yi, interp='nn'): | |||
################################################## | |||
# Linear interpolation algorithms | |||
################################################## | |||
@cbook.deprecated("2.2", alternative="np.interp") |
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.
This needs API changes docs.
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.
done
Also, in contour (the only place that used it), -1 (instead of nan) is a perfectly reasonable marker for out of bounds which avoids having to dance with the errstate.
db1bbd6
to
adb2f8a
Compare
Thanks @anntzer |
Also, in contour (the only place that used it), -1 (instead of nan) is
a perfectly reasonable marker for out of bounds which avoids having to
dance with the errstate.
Replaces #9859: @efiring pointed out and I confirmed that we neither implement nor need linear extrapolation, so np.interp is perfectly sufficient.
Made a separate PR as the approach is somewhat different.
PR Summary
PR Checklist