From 0c3ce8a06f8837b5dd48c2f9e330e29f3c18a1b2 Mon Sep 17 00:00:00 2001 From: marc Date: Fri, 18 Oct 2024 15:01:33 +0200 Subject: [PATCH 1/2] Update to numpy 2+ --- pytools/idfx_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytools/idfx_io.py b/pytools/idfx_io.py index 480e713d..17dc6272 100644 --- a/pytools/idfx_io.py +++ b/pytools/idfx_io.py @@ -29,7 +29,7 @@ def __init__(self, fh, byteorder="little"): dims = [] for dim in range(self.ndims): dims.append(int.from_bytes(fh.read(INT_SIZE), byteorder)) - ntot = int(np.product(dims)) + ntot = int(np.prod(dims)) raw = struct.unpack(str(ntot) + "d", fh.read(DOUBLE_SIZE * ntot)) self.array = np.asarray(raw).reshape(dims[::-1]) From 6c95183e17142a014ab6916e7edc68c8f6c9ffb8 Mon Sep 17 00:00:00 2001 From: marc Date: Mon, 21 Oct 2024 10:46:43 +0200 Subject: [PATCH 2/2] Included numpy to ruff --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d351a7c..726f0045 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,6 +33,7 @@ repos: - F # pyflakes - B # flake8-bugbear - I # isort + - NPY # numpy-specific rules - repo: https://github.com/neutrinoceros/inifix rev: v5.0.2