(self)
| 1143 | gradient, f_2d, np.stack([dx] * 2, axis=-1), 1) |
| 1144 | |
| 1145 | def test_badargs(self): |
| 1146 | f_2d = np.arange(25).reshape(5, 5) |
| 1147 | x = np.cumsum(np.ones(5)) |
| 1148 | |
| 1149 | # wrong sizes |
| 1150 | assert_raises(ValueError, gradient, f_2d, x, np.ones(2)) |
| 1151 | assert_raises(ValueError, gradient, f_2d, 1, np.ones(2)) |
| 1152 | assert_raises(ValueError, gradient, f_2d, np.ones(2), np.ones(2)) |
| 1153 | # wrong number of arguments |
| 1154 | assert_raises(TypeError, gradient, f_2d, x) |
| 1155 | assert_raises(TypeError, gradient, f_2d, x, axis=(0, 1)) |
| 1156 | assert_raises(TypeError, gradient, f_2d, x, x, x) |
| 1157 | assert_raises(TypeError, gradient, f_2d, 1, 1, 1) |
| 1158 | assert_raises(TypeError, gradient, f_2d, x, x, axis=1) |
| 1159 | assert_raises(TypeError, gradient, f_2d, 1, 1, axis=1) |
| 1160 | |
| 1161 | def test_datetime64(self): |
| 1162 | # Make sure gradient() can handle special types like datetime64 |
nothing calls this directly
no test coverage detected