mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-18 12:30:14 +08:00
MAINT: PEP8 fixes and _interpolation_test.pyx -> interpolation.pyx rename
This commit is contained in:
@@ -1,24 +1,23 @@
|
||||
from skimage._shared._interpolation_test import coord_map
|
||||
from skimage._shared.interpolation import coord_map_py
|
||||
from numpy.testing import assert_array_equal
|
||||
|
||||
|
||||
def test_coord_map():
|
||||
|
||||
reflect = [coord_map(4, n, 'R') for n in range(-6, 6)]
|
||||
reflect = [coord_map_py(4, n, 'R') for n in range(-6, 6)]
|
||||
expected_reflect = [2, 3, 3, 2, 1, 0, 0, 1, 2, 3, 3, 2]
|
||||
assert_array_equal(reflect, expected_reflect)
|
||||
|
||||
wrap = [coord_map(4, n, 'W') for n in range(-6, 6)]
|
||||
wrap = [coord_map_py(4, n, 'W') for n in range(-6, 6)]
|
||||
expected_wrap = [2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1]
|
||||
assert_array_equal(wrap, expected_wrap)
|
||||
|
||||
nearest = [coord_map(4, n, 'N') for n in range(-6, 6)]
|
||||
nearest = [coord_map_py(4, n, 'N') for n in range(-6, 6)]
|
||||
expected_neareset = [0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3]
|
||||
assert_array_equal(nearest, expected_neareset)
|
||||
|
||||
mirror = [coord_map(4, n, 'M') for n in range(-6, 6)]
|
||||
mirror = [coord_map_py(4, n, 'M') for n in range(-6, 6)]
|
||||
expected_mirror = [0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1]
|
||||
assert_array_equal(mirror, expected_mirror)
|
||||
|
||||
other = [coord_map(4, n, 'undefined') for n in range(-6, 6)]
|
||||
other = [coord_map_py(4, n, 'undefined') for n in range(-6, 6)]
|
||||
assert_array_equal(other, list(range(-6, 6)))
|
||||
|
||||
Reference in New Issue
Block a user