-
Notifications
You must be signed in to change notification settings - Fork 370
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: imshow arguments should be popped before passing upstream #2416
Conversation
Note that maybe we should add a warning to users that this keyword argument isn't being used rather than dropping it on the floor? Or, we could say "if regrid_shape is passed, don't take the fast-path"? |
98834c9
to
4e19b50
Compare
I'm trying to decide if there's any value in the regridding behavior when plotting in the original coordinates... |
We are thinking the same thing, hence the thrash in my PR pushing 😂 Would you prefer a warning and drop it and go through the fast-path then? Or this is currently not choosing the fast-path, but doesn't really do much. Although it is a much "larger" image technically and thus a larger file when saved to disk, but looks the same. |
lib/cartopy/mpl/geoaxes.py
Outdated
@@ -1281,7 +1281,8 @@ def imshow(self, img, *args, **kwargs): | |||
y0 - eps <= extent[3] <= y1 + eps)) | |||
|
|||
if (transform is None or transform == self.transData or | |||
same_projection and inside_bounds): | |||
same_projection and inside_bounds and | |||
kwargs.get("regrid_shape", None) is None): |
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 would forward on a manually-specified regrid_shape=None
onto Matplotlib, no?
I think until we have an actual use case, we should keep the current semantics, avoid the error, and issue a warning. |
The regrid doesn't do anything, so we should warn the user that we are getting rid of it and continuing on.
4e19b50
to
b46c4d5
Compare
OK, I'm sold. I added a warning message to it now. |
We have extra keyword arguments in Cartopy that can't be passed upstream to Matplotlib, so remove them from the keyword arguments before going into any possible methods.
closes #2415