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

Method test_subclass

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

Source from the content-addressed store, hash-verified

917 assert_equal(out.dtype, exp.dtype)
918
919 def test_subclass(self):
920 x = ma.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]],
921 mask=[[False, False], [True, False],
922 [False, True], [True, True], [False, False]])
923 out = diff(x)
924 assert_array_equal(out.data, [[1], [1], [1], [1], [1]])
925 assert_array_equal(out.mask, [[False], [True],
926 [True], [True], [False]])
927 assert_(type(out) is type(x))
928
929 out3 = diff(x, n=3)
930 assert_array_equal(out3.data, [[], [], [], [], []])
931 assert_array_equal(out3.mask, [[], [], [], [], []])
932 assert_(type(out3) is type(x))
933
934 def test_prepend(self):
935 x = np.arange(5) + 1

Callers

nothing calls this directly

Calls 3

diffFunction · 0.90
assert_array_equalFunction · 0.90
assert_Function · 0.90

Tested by

no test coverage detected