-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
pcolorfast simplifications. #13327
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
pcolorfast simplifications. #13327
Conversation
@@ -6213,7 +6213,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None, | |||
"'norm' must be an instance of 'mcolors.Normalize'") | |||
|
|||
C = args[-1] | |||
nr, nc = C.shape | |||
nr, nc = np.shape(C) |
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.
(supports C being a nested list instead of an array)
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.
Blocking on the discussion of the future of pcolorfast
. See #13328. Of course, this can be cleared if we think pcolorfast should get more work, but as discussed, I think we should consider deprecating it.
This wouldn't do any harm even if we decide to deprecate |
I'll unblock - but I don't think we should be improving this method.
I would be supportive of keeping pcolorfast, even if it is in general of course really bad style to have the return type of the function depend on some (possibly complex) interplay of input parameters. That being said, |
See #13434 for some more testing of pcolorfast. |
My issue w/ |
Let's keep that discussion in #13328, but in that thread I made the point that I disagree with the assessment that the two methods "provide" similar functionalities. Using imshow() to draw an array so that a certain data entry ends up centered at a certain x, y coordinate is, as far as I can tell, extremely awkward (in particular because of the complex interplay between the extent and the origin kwargs). It is true that anything pcolorfast does can be translated into an imshow/pcolorfast/pcolormesh call, but that's like saying that we don't need |
What this PR does is to simplify the internal code of an existing, and for some users viable function. It doesn't add anything, and it doesn't remove anything. So I wouldn't spend too much time with it. Only thing is that such "simplifications" are always a good opportunity to add lacking tests, so if possible, I would like to see #13434 be merged first. |
@ImportanceOfBeingErnest #13434 is merged. |
@ImportanceOfBeingErnest do you want to get this in? :) |
PR Summary
PR Checklist