MCPcopy Create free account
hub / github.com/numpy/numpy / test_values

Method test_values

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

Source from the content-addressed store, hash-verified

1172 assert_equal(gradient(x).dtype, np.diff(x).dtype)
1173
1174 def test_values(self):
1175 # needs at least 2 points for edge_order ==1
1176 gradient(np.arange(2), edge_order=1)
1177 # needs at least 3 points for edge_order ==1
1178 gradient(np.arange(3), edge_order=2)
1179
1180 assert_raises(ValueError, gradient, np.arange(0), edge_order=1)
1181 assert_raises(ValueError, gradient, np.arange(0), edge_order=2)
1182 assert_raises(ValueError, gradient, np.arange(1), edge_order=1)
1183 assert_raises(ValueError, gradient, np.arange(1), edge_order=2)
1184 assert_raises(ValueError, gradient, np.arange(2), edge_order=2)
1185
1186 @pytest.mark.parametrize('f_dtype', [np.uint8, np.uint16,
1187 np.uint32, np.uint64])

Callers

nothing calls this directly

Calls 2

gradientFunction · 0.90
assert_raisesFunction · 0.90

Tested by

no test coverage detected