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

Method test_timedelta64

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

Source from the content-addressed store, hash-verified

1155 # assert_raises(TypeError, gradient, x, axis=[1,])
1156
1157 def test_timedelta64(self):
1158 # Make sure gradient() can handle special types like timedelta64
1159 x = np.array(
1160 [-5, -3, 10, 12, 61, 321, 300],
1161 dtype='timedelta64[D]')
1162 dx = np.array(
1163 [2, 7, 7, 25, 154, 119, -21],
1164 dtype='timedelta64[D]')
1165 assert_array_equal(gradient(x), dx)
1166 assert_(dx.dtype == np.dtype('timedelta64[D]'))
1167
1168 def test_inexact_dtypes(self):
1169 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