@@ -38,33 +38,33 @@ class FixedScaleOffset(Codec):
3838 >>> import numpy as np
3939 >>> x = np.linspace(1000, 1001, 10, dtype='f8')
4040 >>> x
41- array([ 1000. , 1000.11111111, 1000.22222222, 1000.33333333,
42- 1000.44444444, 1000.55555556, 1000.66666667, 1000.77777778,
43- 1000.88888889, 1001. ])
41+ array([1000. , 1000.11111111, 1000.22222222, 1000.33333333,
42+ 1000.44444444, 1000.55555556, 1000.66666667, 1000.77777778,
43+ 1000.88888889, 1001. ])
4444 >>> codec = numcodecs.FixedScaleOffset(offset=1000, scale=10, dtype='f8', astype='u1')
4545 >>> y1 = codec.encode(x)
4646 >>> y1
4747 array([ 0, 1, 2, 3, 4, 6, 7, 8, 9, 10], dtype=uint8)
4848 >>> z1 = codec.decode(y1)
4949 >>> z1
50- array([ 1000. , 1000.1, 1000.2, 1000.3, 1000.4, 1000.6, 1000.7,
51- 1000.8, 1000.9, 1001. ])
50+ array([1000. , 1000.1, 1000.2, 1000.3, 1000.4, 1000.6, 1000.7,
51+ 1000.8, 1000.9, 1001. ])
5252 >>> codec = numcodecs.FixedScaleOffset(offset=1000, scale=10**2, dtype='f8', astype='u1')
5353 >>> y2 = codec.encode(x)
5454 >>> y2
55- array([ 0, 11, 22, 33, 44, 56, 67, 78, 89, 100], dtype=uint8)
55+ array([ 0, 11, 22, 33, 44, 56, 67, 78, 89, 100], dtype=uint8)
5656 >>> z2 = codec.decode(y2)
5757 >>> z2
58- array([ 1000. , 1000.11, 1000.22, 1000.33, 1000.44, 1000.56,
59- 1000.67, 1000.78, 1000.89, 1001. ])
58+ array([1000. , 1000.11, 1000.22, 1000.33, 1000.44, 1000.56,
59+ 1000.67, 1000.78, 1000.89, 1001. ])
6060 >>> codec = numcodecs.FixedScaleOffset(offset=1000, scale=10**3, dtype='f8', astype='u2')
6161 >>> y3 = codec.encode(x)
6262 >>> y3
63- array([ 0, 111, 222, 333, 444, 556, 667, 778, 889, 1000], dtype=uint16)
63+ array([ 0, 111, 222, 333, 444, 556, 667, 778, 889, 1000], dtype=uint16)
6464 >>> z3 = codec.decode(y3)
6565 >>> z3
66- array([ 1000. , 1000.111, 1000.222, 1000.333, 1000.444, 1000.556,
67- 1000.667, 1000.778, 1000.889, 1001. ])
66+ array([1000. , 1000.111, 1000.222, 1000.333, 1000.444, 1000.556,
67+ 1000.667, 1000.778, 1000.889, 1001. ])
6868
6969 See Also
7070 --------
0 commit comments