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
Let _pcolorargs check C for consistency with X and Y; closes #1688 #2063
Conversation
Looks good. Understanding that |
This error was revealed by the new checking in _pcolorargs.
There is an unrelated Travis test failure on Python 3.3. I think this is ready to merge. |
@@ -7339,6 +7361,15 @@ def _pcolorargs(self, funcname, *args): | |||
raise TypeError( | |||
'Incompatible X, Y inputs to %s; see help(%s)' % ( | |||
funcname, funcname)) | |||
if allmatch: | |||
if not (Nx == numCols and Ny == numRows): | |||
raise TypeError('Dimensions of C are incompatible with' |
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.
These exceptions are probably going to be quite common. I wonder if it is worth making them slightly better by providing some shape information?
I see that they are TypeErrors for consistency, but maybe they should be ValueErrors instead...
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.
@pelson, "yes" to both of these comments. I considered the change to ValueError, but decided that was best left for a later PR, first because it could break user code, and second because I think this is not the only place where that switch should be made.
👍 from me. |
I have merged this manually with the additional information in the error message as suggested by @pelson. |
FYI: Merge commit is 7e49a5e |
This is a minimal change to close #1688.