-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Clarify error messages #232
Clarify error messages #232
Conversation
Codecov Report
@@ Coverage Diff @@
## master #232 +/- ##
=======================================
Coverage 97.61% 97.61%
=======================================
Files 11 11
Lines 1549 1549
=======================================
Hits 1512 1512
Misses 37 37
Continue to review full report at Codecov.
|
raise ValueError('Inconsistent fill-values in the result array: operating on the ndarray with' | ||
' fill-values produces inconsistent results.') | ||
raise ValueError('Performing a mixed sparse-dense operation that would result in a dense array. ' | ||
'Please make sure that func(sparse_fill_values, ndarrays) is a constant 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.
What is func?
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.
The element-wise function one wants to apply.
@@ -507,8 +507,8 @@ def _check_broadcast(self): | |||
) | |||
|
|||
if full_shape != non_ndarray_shape: | |||
raise ValueError('All ndarrays must be broadcastable to the shape without ndarrays {}' | |||
.format(non_ndarray_shape)) | |||
raise ValueError('Please make sure that the broadcast shape of just the sparse arrays is ' |
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.
So in the case of a binary operation between dense and sparse as in the issue, "just the sparse arrays" is the one array, so broadcasting the sparse array is not allowed?
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.
Correct.
@asmeurer Do you think these error messages are fine or do they need refining? Feel free to suggest other (clearer) wordings. 🙂 |
Fixes #231
Fixes #230
@asmeurer Please make sure that these error messages are clear to you... I'm used to speaking deep NumPy-speak, and so I may be a bit blinded. 🙂