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

Method test_datetime64

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

Source from the content-addressed store, hash-verified

1159 assert_raises(TypeError, gradient, f_2d, 1, 1, axis=1)
1160
1161 def test_datetime64(self):
1162 # Make sure gradient() can handle special types like datetime64
1163 x = np.array(
1164 ['1910-08-16', '1910-08-11', '1910-08-10', '1910-08-12',
1165 '1910-10-12', '1910-12-12', '1912-12-12'],
1166 dtype='datetime64[D]')
1167 dx = np.array(
1168 [-5, -3, 0, 31, 61, 396, 731],
1169 dtype='timedelta64[D]')
1170 assert_array_equal(gradient(x), dx)
1171 assert_(dx.dtype == np.dtype('timedelta64[D]'))
1172
1173 def test_masked(self):
1174 # Make sure that gradient supports subclasses like masked arrays

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