(self)
| 3089 | |
| 3090 | class TestMinMax: |
| 3091 | def test_minmax_blocked(self): |
| 3092 | # simd tests on max/min, test all alignments, slow but important |
| 3093 | # for 2 * vz + 2 * (vs - 1) + 1 (unrolled once) |
| 3094 | for dt, sz in [(np.float32, 15), (np.float64, 7)]: |
| 3095 | for out, inp, msg in _gen_alignment_data(dtype=dt, type='unary', |
| 3096 | max_size=sz): |
| 3097 | for i in range(inp.size): |
| 3098 | inp[:] = np.arange(inp.size, dtype=dt) |
| 3099 | inp[i] = np.nan |
| 3100 | emsg = lambda: f'{inp!r}\n{msg}' |
| 3101 | with warnings.catch_warnings(): |
| 3102 | warnings.filterwarnings( |
| 3103 | 'ignore', |
| 3104 | "invalid value encountered in reduce", |
| 3105 | RuntimeWarning) |
| 3106 | assert_(np.isnan(inp.max()), msg=emsg) |
| 3107 | assert_(np.isnan(inp.min()), msg=emsg) |
| 3108 | |
| 3109 | inp[i] = 1e10 |
| 3110 | assert_equal(inp.max(), 1e10, err_msg=msg) |
| 3111 | inp[i] = -1e10 |
| 3112 | assert_equal(inp.min(), -1e10, err_msg=msg) |
| 3113 | |
| 3114 | def test_lower_align(self): |
| 3115 | # check data that is not aligned to element size |
nothing calls this directly
no test coverage detected