(self)
| 2798 | |
| 2799 | class TestMinMax: |
| 2800 | def test_minmax_blocked(self): |
| 2801 | # simd tests on max/min, test all alignments, slow but important |
| 2802 | # for 2 * vz + 2 * (vs - 1) + 1 (unrolled once) |
| 2803 | for dt, sz in [(np.float32, 15), (np.float64, 7)]: |
| 2804 | for out, inp, msg in _gen_alignment_data(dtype=dt, type='unary', |
| 2805 | max_size=sz): |
| 2806 | for i in range(inp.size): |
| 2807 | inp[:] = np.arange(inp.size, dtype=dt) |
| 2808 | inp[i] = np.nan |
| 2809 | emsg = lambda: '%r\n%s' % (inp, msg) |
| 2810 | with suppress_warnings() as sup: |
| 2811 | sup.filter(RuntimeWarning, |
| 2812 | "invalid value encountered in reduce") |
| 2813 | assert_(np.isnan(inp.max()), msg=emsg) |
| 2814 | assert_(np.isnan(inp.min()), msg=emsg) |
| 2815 | |
| 2816 | inp[i] = 1e10 |
| 2817 | assert_equal(inp.max(), 1e10, err_msg=msg) |
| 2818 | inp[i] = -1e10 |
| 2819 | assert_equal(inp.min(), -1e10, err_msg=msg) |
| 2820 | |
| 2821 | def test_lower_align(self): |
| 2822 | # check data that is not aligned to element size |
nothing calls this directly
no test coverage detected