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

Method test_timedelta64

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

Source from the content-addressed store, hash-verified

1296 # assert_raises(TypeError, gradient, x, axis=[1,])
1297
1298 def test_timedelta64(self):
1299 # Make sure gradient() can handle special types like timedelta64
1300 x = np.array(
1301 [-5, -3, 10, 12, 61, 321, 300],
1302 dtype='timedelta64[D]')
1303 dx = np.array(
1304 [2, 7, 7, 25, 154, 119, -21],
1305 dtype='timedelta64[D]')
1306 assert_array_equal(gradient(x), dx)
1307 assert_(dx.dtype == np.dtype('timedelta64[D]'))
1308
1309 def test_inexact_dtypes(self):
1310 for dt in [np.float16, np.float32, np.float64]:

Callers

nothing calls this directly

Calls 4

assert_array_equalFunction · 0.90
gradientFunction · 0.90
assert_Function · 0.90
dtypeMethod · 0.45

Tested by

no test coverage detected