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

Method test_simple

numpy/_core/tests/test_multiarray.py:8520–8536  ·  view source on GitHub ↗
(self, dt)

Source from the content-addressed store, hash-verified

8518
8519 # Simple, 1d tests
8520 def test_simple(self, dt):
8521 # Test padding with constant values
8522 x = np.linspace(1, 5, 5).astype(dt)
8523 r = [[0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 0]]
8524 l = _multiarray_tests.test_neighborhood_iterator(
8525 x, [-1, 1], x[0], NEIGH_MODE['zero'])
8526 assert_array_equal(l, r)
8527
8528 r = [[1, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 1]]
8529 l = _multiarray_tests.test_neighborhood_iterator(
8530 x, [-1, 1], x[0], NEIGH_MODE['one'])
8531 assert_array_equal(l, r)
8532
8533 r = [[x[4], 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, x[4]]]
8534 l = _multiarray_tests.test_neighborhood_iterator(
8535 x, [-1, 1], x[4], NEIGH_MODE['constant'])
8536 assert_array_equal(l, r)
8537
8538 # Test mirror modes
8539 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