diff --git a/numcodecs/tests/test_fixedscaleoffset.py b/numcodecs/tests/test_fixedscaleoffset.py index daa64220..337e893e 100644 --- a/numcodecs/tests/test_fixedscaleoffset.py +++ b/numcodecs/tests/test_fixedscaleoffset.py @@ -36,12 +36,20 @@ def test_encode_decode(): check_encode_decode(arr, codec, precision=precision) -def test_encode(): +@pytest.mark.parametrize( + ("offset", "scale", "expected"), + [ + (1000, 10, [0, 6, 11, 17, 22, 28, 33, 39, 44, 50]), + (1002.5, 10, [-25, -19, -14, -8, -3, 3, 8, 14, 19, 25]), + (1000, 0.5, [0, 0, 1, 1, 1, 1, 2, 2, 2, 2]), + ], +) +def test_encode(offset: float, scale: float, expected: list[int]): dtype = '