Skip to content
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

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

greglucas
Copy link
Contributor

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

@greglucas
Copy link
Contributor Author

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"?

@greglucas greglucas marked this pull request as draft July 11, 2024 21:51
@dopplershift
Copy link
Contributor

I'm trying to decide if there's any value in the regridding behavior when plotting in the original coordinates...

@greglucas
Copy link
Contributor Author

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.

@@ -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):
Copy link
Contributor

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?

@dopplershift
Copy link
Contributor

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.
@greglucas
Copy link
Contributor Author

OK, I'm sold. I added a warning message to it now.

@greglucas greglucas marked this pull request as ready for review July 11, 2024 22:34
@dopplershift dopplershift merged commit b8618af into SciTools:main Jul 12, 2024
19 of 21 checks passed
@dopplershift dopplershift added this to the Next Release milestone Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

regrid_shape is an unexpected keyword
2 participants