This commit is contained in:
@@ -57,7 +57,7 @@ def test_nice_steps_left_aligned(start, stop, step, endpoint, expected):
|
||||
@pytest.mark.parametrize("start, stop, step, endpoint, expected", [
|
||||
(0, 5, 2, True, np.array([6., 4., 2., 0.])), # Right-aligned, overshoots left
|
||||
(0, 5, 2, False, np.array([4., 2., 0.])), # Right-aligned, no endpoint
|
||||
(-1, 2, 1.5, True, np.array([2., 0.5, -1.])), # Step doesn’t divide evenly, reverse it
|
||||
(-1, 2, 1.5, True, np.array([2., 0.5, -1.])), # Step doesn t divide evenly, reverse it
|
||||
(-1, 2, 1.5, False, np.array([0.5, -1.])), # Without endpoint
|
||||
(5, 0, -2, True, np.array([5., 3., 1., -1.])), # Negative step, includes endpoint overshoot
|
||||
(5, 0, -2, False, np.array([3., 1., -1.])), # No endpoint, skips last one
|
||||
@@ -82,7 +82,7 @@ def test_within_scalar(val, vmin, vmax, expected):
|
||||
@pytest.mark.parametrize("data, vmin, vmax, expected", [
|
||||
([1, 2, 3, 4, 5], 2, 5, 0.6),
|
||||
([10, 20, 30], 5, 25, 2/3),
|
||||
([1, 2, 3], None, 2, 2/3),
|
||||
([1, 2, 3], None, 2, 1/3),
|
||||
([], 0, 1, 0),
|
||||
])
|
||||
def test_within_fraction(data, vmin, vmax, expected):
|
||||
|
||||
Reference in New Issue
Block a user