From d7189882bb3d658b77e0c8d8cf422d20165691c4 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Fri, 10 Jan 2025 21:44:04 +0100 Subject: [PATCH] Apply ruff preview rule RUF046 RUF046 Value being casted is already an integer --- numcodecs/quantize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numcodecs/quantize.py b/numcodecs/quantize.py index b5b6cc3c..329a6d3d 100644 --- a/numcodecs/quantize.py +++ b/numcodecs/quantize.py @@ -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