BUG: test all ufunc.types for return type, fix for exp, log#13495
BUG: test all ufunc.types for return type, fix for exp, log#13495charris merged 1 commit intonumpy:masterfrom
Conversation
|
I don't see any types with ',', or that need to be stripped. EDIT1: Otherwise LGTM. EDIT2: Might even be best to fail for cases like that if they are errors. (Don't know if they are) |
It seems I got confused with gufunc signature, which has richer syntax than type signature. The latter contains only type letters and |
numpy/core/tests/test_ufunc.py
Outdated
There was a problem hiding this comment.
What happens to all the recorded warnings?
There was a problem hiding this comment.
Could get the same effect by just ignoring them :)
There was a problem hiding this comment.
made the ignore explicit in the next line. Without record=True the test passes but all the warnings are printed out
There was a problem hiding this comment.
Shouldn't be printed out if they are ignored.
There was a problem hiding this comment.
hmm, filterwarnings('ignore') is not supported by pytest. @charris what change are you suggesting?
There was a problem hiding this comment.
The failing test is one of ours that looks for "ignore" because using that used to mess up the warnings module.
There was a problem hiding this comment.
The code in this PR follows the pattern in other places in the tests. Maybe we can accept this PR as-is and explore best practices for warnings in a separate issue/PR
There was a problem hiding this comment.
Catch warnings is OK, it just catches all warnings, which is not ideal (and suppress_warnings can be nested and works reasonable then). Should double check, but the doc I put on suppress_warnings indeed suggests that "ignore" filters should be fine in numpy 1.17. I remember there were still some oddities, but I do not think they were relevant for this.
There was a problem hiding this comment.
@seberg Sounds like we can disable the test and clean things up after we drop 1.16 support.
There was a problem hiding this comment.
@charris do you mean the "no ignore warnings test"? This here should work in any case, maybe not the prettiest, but suppress_warnings is also not perfect.
|
Thanks Matti. |
Fixes #13493 by registering a non-simd loop for 'e' (half) before the 'f' (float) one.
Also added a test that all ufuncs respect the types they declare