Skip to content

ENH: clarify error message of broadcast - #6900

Merged
charris merged 1 commit into
numpy:masterfrom
kohr-h:master
Jan 4, 2016
Merged

charris merged 1 commit into
numpy:masterfrom
kohr-h:master

Conversation

@kohr-h

@kohr-h kohr-h commented Dec 30, 2015

Copy link
Copy Markdown
Contributor

Fix for #6898. What about the brackets around the maximum number of arguments? Could also be removed while we're at it.

@gfyoung

gfyoung commented Dec 30, 2015

Copy link
Copy Markdown
Contributor

There are several other instances of that ValueError with the exact same message in the same file. You might want to look at those too, but you can wait to see what one of the owners think.

@kohr-h

kohr-h commented Dec 30, 2015

Copy link
Copy Markdown
Contributor Author

Sure, a common formulation in "Numpy style" would be good.

@jaimefrio

Copy link
Copy Markdown
Member

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...

@kohr-h

kohr-h commented Dec 30, 2015

Copy link
Copy Markdown
Contributor Author

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.

Comment thread numpy/core/src/multiarray/iterators.c Outdated

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did that.

charris added a commit that referenced this pull request Jan 4, 2016
ENH: clarify error message of broadcast
@charris
charris merged commit e072d79 into numpy:master Jan 4, 2016
@charris

charris commented Jan 4, 2016

Copy link
Copy Markdown
Member

Thanks @kohr-h .

@charris

charris commented Jan 4, 2016

Copy link
Copy Markdown
Member

For future reference, this is more MAINT than ENH ;)

@kohr-h

kohr-h commented Jan 4, 2016

Copy link
Copy Markdown
Contributor Author

Alright, got it. ;-)

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.

4 participants