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

Method test_mirror

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

Source from the content-addressed store, hash-verified

7503
7504 # Test mirror modes
7505 def test_mirror(self, dt):
7506 x = np.linspace(1, 5, 5).astype(dt)
7507 r = np.array([[2, 1, 1, 2, 3], [1, 1, 2, 3, 4], [1, 2, 3, 4, 5],
7508 [2, 3, 4, 5, 5], [3, 4, 5, 5, 4]], dtype=dt)
7509 l = _multiarray_tests.test_neighborhood_iterator(
7510 x, [-2, 2], x[1], NEIGH_MODE['mirror'])
7511 assert_([i.dtype == dt for i in l])
7512 assert_array_equal(l, r)
7513
7514 # Circular mode
7515 def test_circular(self, dt):

Callers

nothing calls this directly

Calls 4

assert_Function · 0.90
assert_array_equalFunction · 0.90
astypeMethod · 0.80
linspaceMethod · 0.80

Tested by

no test coverage detected