-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Fixes Numpy datatype compatibility issues #8215
Conversation
This is not the right fix. The check for float16 needs to be done in the C code of ndimage. |
@pv I will update this PR with float16 check in C code |
@pv please review and see if changes are required or not. |
IMO adding a test for this is trivial:
|
Okay, I will add test cases for this one |
scipy/ndimage/tests/test_filters.py
Outdated
data = np.array([1],dtype = np.float16) | ||
sigma = 1.0 | ||
with assert_raises(RuntimeError): | ||
sndi.gaussian_filter(data,sigma) |
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.
Nit: indent with four spaces instead of a tab.
ping @xoviat |
@xoviat is this PR ready to be merged or some more work is needed? |
Also add a test for it.
I rebased this and replaced the magic number check |
thanks, merged |
Fixes #8207
Taking input as float16 datatype will give segmentation fault, since there are no corresponding types for it in C language. Here I am taking input as float64 type to avoid datatype incompatibility.