diff --git a/tests/test_utils_npy.py b/tests/test_utils_npy.py index 338eea1b1..0ff6d4bc8 100644 --- a/tests/test_utils_npy.py +++ b/tests/test_utils_npy.py @@ -7,10 +7,10 @@ from slic.utils.npy import * @pytest.mark.parametrize("start, stop, step, expected", [ (0, 5, 1, [0, 1, 2, 3, 4, 5]), - (5, 0, -1, [5, 4, 3, 2, 1, 0]), + (5, 0, -1, [0, 1, 2, 3, 4, 5]), (1, 2, 3/10, [1, 4/3, 5/3, 2]), (-2, 2, 3/2, [-2, -2/3, 2/3, 2]), - (5/2, 1/2, -2/5, [5/2, 21/10, 17/10, 13/10, 9/10, 1/2]) + (5/2, 1/2, -2/5, [1/2, 9/10, 13/10, 17/10, 21/10, 5/2]) ]) def test_nice_arange(start, stop, step, expected): np.testing.assert_allclose(nice_arange(start, stop, step), expected) @@ -24,6 +24,7 @@ def test_nice_arange(start, stop, step, expected): (2, 2, 3, np.array([2., 2., 2., 2.])), # constant start = stop (3, 0, 3, np.array([3., 2., 1., 0.])), # decreasing (0, 1, 0, np.array([0.])), # edge case: 0 intervals → 1 point + (-2, 2, 3, np.array([-2, -2/3, 2/3, 2])), ]) def test_nice_linspace(start, stop, num, expected): np.testing.assert_allclose(nice_linspace(start, stop, num), expected)