(self)
| 2163 | assert_almost_equal(r, qz) |
| 2164 | |
| 2165 | def test_masked(self): |
| 2166 | # Testing that masked arrays behave as if the function is 0 where |
| 2167 | # masked |
| 2168 | x = np.arange(5) |
| 2169 | y = x * x |
| 2170 | mask = x == 2 |
| 2171 | ym = np.ma.array(y, mask=mask) |
| 2172 | r = 13.0 # sum(0.5 * (0 + 1) * 1.0 + 0.5 * (9 + 16)) |
| 2173 | assert_almost_equal(trapz(ym, x), r) |
| 2174 | |
| 2175 | xm = np.ma.array(x, mask=mask) |
| 2176 | assert_almost_equal(trapz(ym, xm), r) |
| 2177 | |
| 2178 | xm = np.ma.array(x, mask=mask) |
| 2179 | assert_almost_equal(trapz(y, xm), r) |
| 2180 | |
| 2181 | |
| 2182 | class TestSinc: |
nothing calls this directly
no test coverage detected