Skip to content

Commit e9efcc4

Browse files
committed
Linting
1 parent 9b813bf commit e9efcc4

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

numcodecs/bitinfo.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def __init__(self, info_level: float, axes=None):
4949
self.info_level = info_level
5050
self.axes = axes
5151

52-
5352
def encode(self, buf):
5453
"""Create int array by rounding floating-point data
5554
@@ -251,15 +250,15 @@ def get_keepbits(info_per_bit, inflevel=0.99):
251250
----------
252251
info_per_bit : array
253252
Information content of each bit from `get_bitinformation`.
254-
253+
255254
inflevel : float
256255
Level of information that shall be preserved.
257256
258257
Returns
259258
-------
260259
keepbits : int
261260
Number of mantissa bits to keep
262-
261+
263262
"""
264263
if (inflevel < 0) or (inflevel > 1.0):
265264
raise ValueError("Please provide `inflevel` from interval [0.,1.]")
@@ -275,8 +274,7 @@ def get_keepbits(info_per_bit, inflevel=0.99):
275274

276275
def _cdf_from_info_per_bit(info_per_bit):
277276
"""Convert info_per_bit to cumulative distribution function"""
278-
# TODO this threshold doesn't match implementation in remove_insignificant.jl
279-
tol = info_per_bit[-4:].max() * 1.1 # reduced from 1.5
277+
tol = info_per_bit[-4:].max() * 1.1 # reduced from 1.5
280278
info_per_bit[info_per_bit < tol] = 0
281279
cdf = info_per_bit.cumsum()
282280
return cdf / cdf[-1]

numcodecs/tests/test_bitinfo.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from numcodecs.bitinfo import BitInfo, exponent_bias, mutual_information
66

7+
78
def test_bitinfo_initialization():
89
bitinfo = BitInfo(0.5)
910
assert bitinfo.info_level == 0.5
@@ -66,7 +67,7 @@ def test_mutual_information():
6667
b = a + 1000
6768
c = a[::-1].copy()
6869
dt = np.dtype('uint32')
69-
a,b,c = map(lambda x: x.view(dt), [a,b,c])
70+
a, b, c = map(lambda x: x.view(dt), [a, b, c])
7071

7172
assert mutual_information(a, a).sum() == 7.020411549771797
7273
assert mutual_information(a, b).sum() == 0.0

0 commit comments

Comments
 (0)