MCPcopy Index your code
hub / github.com/numpy/numpy / test_values

Method test_values

numpy/lib/tests/test_function_base.py:1315–1325  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1313 assert_equal(gradient(x).dtype, np.diff(x).dtype)
1314
1315 def test_values(self):
1316 # needs at least 2 points for edge_order ==1
1317 gradient(np.arange(2), edge_order=1)
1318 # needs at least 3 points for edge_order ==1
1319 gradient(np.arange(3), edge_order=2)
1320
1321 assert_raises(ValueError, gradient, np.arange(0), edge_order=1)
1322 assert_raises(ValueError, gradient, np.arange(0), edge_order=2)
1323 assert_raises(ValueError, gradient, np.arange(1), edge_order=1)
1324 assert_raises(ValueError, gradient, np.arange(1), edge_order=2)
1325 assert_raises(ValueError, gradient, np.arange(2), edge_order=2)
1326
1327 @pytest.mark.parametrize('f_dtype', [np.uint8, np.uint16,
1328 np.uint32, np.uint64])

Callers

nothing calls this directly

Calls 2

gradientFunction · 0.90
assert_raisesFunction · 0.90

Tested by

no test coverage detected