-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
ENH: clarify error message of broadcast #6900
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
There are several other instances of that |
Sure, a common formulation in "Numpy style" would be good. |
There is certainly no need for the brackets. Since the second value will be numeric, it probably makes sense that the first one is as well. And the wording should be identical for all instances of the same error, but I don't think we have a NumPy style for this, use your best judgement, and whatever you come up with should be good. FWIW, I like the at least / at most wording better than the (inclusive) one... |
I found 3 places with similar messages in the same file and applied the same style at least / at most to all of them. Brackets are gone and numbers are printed as numeric values now. |
@@ -1458,8 +1458,8 @@ PyArray_MultiIterFromObjects(PyObject **mps, int n, int nadd, ...) | |||
ntot = n + nadd; | |||
if (ntot < 2 || ntot > NPY_MAXARGS) { | |||
PyErr_Format(PyExc_ValueError, | |||
"Need between 2 and (%d) " \ | |||
"array objects (inclusive).", NPY_MAXARGS); | |||
"Need at least 2 and at most %d " \ |
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.
You can get rid of the \
also.
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.
Did that.
ENH: clarify error message of broadcast
Thanks @kohr-h . |
For future reference, this is more |
Alright, got it. ;-) |
Fix for #6898. What about the brackets around the maximum number of arguments? Could also be removed while we're at it.