(self, dtype, ufunc)
| 2222 | @pytest.mark.parametrize("ufunc", |
| 2223 | [np.add, np.subtract, np.divide, np.minimum, np.maximum]) |
| 2224 | def test_at_negative_indexes(self, dtype, ufunc): |
| 2225 | a = np.arange(0, 10).astype(dtype) |
| 2226 | indxs = np.array([-1, 1, -1, 2]).astype(np.intp) |
| 2227 | vals = np.array([1, 5, 2, 10], dtype=a.dtype) |
| 2228 | |
| 2229 | expected = a.copy() |
| 2230 | for i, v in zip(indxs, vals): |
| 2231 | expected[i] = ufunc(expected[i], v) |
| 2232 | |
| 2233 | ufunc.at(a, indxs, vals) |
| 2234 | assert_array_equal(a, expected) |
| 2235 | assert np.all(indxs == [-1, 1, -1, 2]) |
| 2236 | |
| 2237 | def test_at_not_none_signature(self): |
| 2238 | # Test ufuncs with non-trivial signature raise a TypeError |
nothing calls this directly
no test coverage detected