(self)
| 81 | |
| 82 | class TestPutAlongAxis: |
| 83 | def test_replace_max(self): |
| 84 | a_base = np.array([[10, 30, 20], [60, 40, 50]]) |
| 85 | |
| 86 | for axis in list(range(a_base.ndim)) + [None]: |
| 87 | # we mutate this in the loop |
| 88 | a = a_base.copy() |
| 89 | |
| 90 | # replace the max with a small value |
| 91 | i_max = _add_keepdims(np.argmax)(a, axis=axis) |
| 92 | put_along_axis(a, i_max, -99, axis=axis) |
| 93 | |
| 94 | # find the new minimum, which should max |
| 95 | i_min = _add_keepdims(np.argmin)(a, axis=axis) |
| 96 | |
| 97 | assert_equal(i_min, i_max) |
| 98 | |
| 99 | def test_broadcast(self): |
| 100 | """ Test that non-indexing dimensions are broadcast in both directions """ |
nothing calls this directly
no test coverage detected