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

Method test_simple

numpy/core/tests/test_multiarray.py:7486–7502  ·  view source on GitHub ↗
(self, dt)

Source from the content-addressed store, hash-verified

7484
7485 # Simple, 1d tests
7486 def test_simple(self, dt):
7487 # Test padding with constant values
7488 x = np.linspace(1, 5, 5).astype(dt)
7489 r = [[0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 0]]
7490 l = _multiarray_tests.test_neighborhood_iterator(
7491 x, [-1, 1], x[0], NEIGH_MODE['zero'])
7492 assert_array_equal(l, r)
7493
7494 r = [[1, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 1]]
7495 l = _multiarray_tests.test_neighborhood_iterator(
7496 x, [-1, 1], x[0], NEIGH_MODE['one'])
7497 assert_array_equal(l, r)
7498
7499 r = [[x[4], 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, x[4]]]
7500 l = _multiarray_tests.test_neighborhood_iterator(
7501 x, [-1, 1], x[4], NEIGH_MODE['constant'])
7502 assert_array_equal(l, r)
7503
7504 # Test mirror modes
7505 def test_mirror(self, dt):

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
astypeMethod · 0.80
linspaceMethod · 0.80

Tested by

no test coverage detected