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

Method test_times

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

Source from the content-addressed store, hash-verified

770 assert_equal(len(out), max(0, len(x) - n))
771
772 def test_times(self):
773 x = np.arange('1066-10-13', '1066-10-16', dtype=np.datetime64)
774 expected = [
775 np.array([1, 1], dtype='timedelta64[D]'),
776 np.array([0], dtype='timedelta64[D]'),
777 ]
778 expected.extend([np.array([], dtype='timedelta64[D]')] * 3)
779 for n, exp in enumerate(expected, start=1):
780 out = diff(x, n=n)
781 assert_array_equal(out, exp)
782 assert_equal(out.dtype, exp.dtype)
783
784 def test_subclass(self):
785 x = ma.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]],

Callers

nothing calls this directly

Calls 3

diffFunction · 0.90
assert_array_equalFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected