Skip to content

Commit

Permalink
Apply ruff preview rule RUF046
Browse files Browse the repository at this point in the history
RUF046 Value being casted is already an integer
  • Loading branch information
DimitriPapadopoulos committed Jan 15, 2025
1 parent 5502dc8 commit d718988
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numcodecs/quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def encode(self, buf):
precision = 10.0**-self.digits
exp = math.log10(precision)
if exp < 0:
exp = int(math.floor(exp))
exp = math.floor(exp)
else:
exp = int(math.ceil(exp))
exp = math.ceil(exp)
bits = math.ceil(math.log2(10.0**-exp))
scale = 2.0**bits
enc = np.around(scale * arr) / scale
Expand Down

0 comments on commit d718988

Please sign in to comment.