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

Method test_basic

numpy/lib/tests/test_shape_base.py:726–735  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

724
725class TestTile:
726 def test_basic(self):
727 a = np.array([0, 1, 2])
728 b = [[1, 2], [3, 4]]
729 assert_equal(tile(a, 2), [0, 1, 2, 0, 1, 2])
730 assert_equal(tile(a, (2, 2)), [[0, 1, 2, 0, 1, 2], [0, 1, 2, 0, 1, 2]])
731 assert_equal(tile(a, (1, 2)), [[0, 1, 2, 0, 1, 2]])
732 assert_equal(tile(b, 2), [[1, 2, 1, 2], [3, 4, 3, 4]])
733 assert_equal(tile(b, (2, 1)), [[1, 2], [3, 4], [1, 2], [3, 4]])
734 assert_equal(tile(b, (2, 2)), [[1, 2, 1, 2], [3, 4, 3, 4],
735 [1, 2, 1, 2], [3, 4, 3, 4]])
736
737 def test_tile_one_repetition_on_array_gh4679(self):
738 a = np.arange(5)

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
tileFunction · 0.90

Tested by

no test coverage detected