Skip to content

Commit ffde755

Browse files
committed
Adjust tolerance but still needs fix
1 parent f38891b commit ffde755

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

numcodecs/bitinfo.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ def get_keepbits(info_per_bit, inflevel=0.99):
266266

267267
def _cdf_from_info_per_bit(info_per_bit):
268268
"""Convert info_per_bit to cumulative distribution function"""
269-
# TODO this threshold isn't working yet
270-
#tol = info_per_bit[-4:].max() * 1.5
271-
#info_per_bit[info_per_bit < tol] = 0
269+
# TODO this threshold doesn't match implementation in remove_insignificant.jl
270+
tol = info_per_bit[-4:].max() * 1.1 # reduced from 1.5
271+
info_per_bit[info_per_bit < tol] = 0
272272
cdf = info_per_bit.cumsum()
273273
return cdf / cdf[-1]

0 commit comments

Comments
 (0)