(self)
| 1002 | gradient, f_2d, np.stack([dx]*2, axis=-1), 1) |
| 1003 | |
| 1004 | def test_badargs(self): |
| 1005 | f_2d = np.arange(25).reshape(5, 5) |
| 1006 | x = np.cumsum(np.ones(5)) |
| 1007 | |
| 1008 | # wrong sizes |
| 1009 | assert_raises(ValueError, gradient, f_2d, x, np.ones(2)) |
| 1010 | assert_raises(ValueError, gradient, f_2d, 1, np.ones(2)) |
| 1011 | assert_raises(ValueError, gradient, f_2d, np.ones(2), np.ones(2)) |
| 1012 | # wrong number of arguments |
| 1013 | assert_raises(TypeError, gradient, f_2d, x) |
| 1014 | assert_raises(TypeError, gradient, f_2d, x, axis=(0,1)) |
| 1015 | assert_raises(TypeError, gradient, f_2d, x, x, x) |
| 1016 | assert_raises(TypeError, gradient, f_2d, 1, 1, 1) |
| 1017 | assert_raises(TypeError, gradient, f_2d, x, x, axis=1) |
| 1018 | assert_raises(TypeError, gradient, f_2d, 1, 1, axis=1) |
| 1019 | |
| 1020 | def test_datetime64(self): |
| 1021 | # Make sure gradient() can handle special types like datetime64 |
nothing calls this directly
no test coverage detected