From 7752c52b278def0fad0c59b671890f054c28ea9c Mon Sep 17 00:00:00 2001 From: Thomas Gastine Date: Mon, 29 Jul 2024 17:40:19 +0200 Subject: [PATCH] replace deprecated np.product by np.prod in npfile.f90 --- python/magic/npfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/magic/npfile.py b/python/magic/npfile.py index 95132377..ae0c22e7 100644 --- a/python/magic/npfile.py +++ b/python/magic/npfile.py @@ -204,7 +204,7 @@ def read_array(self, dt, shape=-1, endian=None, order=None): if minus_ones == 0: pass elif minus_ones == 1: - known_dimensions_size = -np.product(shape,axis=0) * dt.itemsize + known_dimensions_size = -np.prod(shape,axis=0) * dt.itemsize unknown_dimension_size, illegal = divmod(self.remaining_bytes(), known_dimensions_size) if illegal: @@ -213,7 +213,7 @@ def read_array(self, dt, shape=-1, endian=None, order=None): else: raise ValueError( "illegal -1 count; can only specify one unknown dimension") - sz = dt.itemsize * np.product(shape) + sz = dt.itemsize * np.prod(shape) dt_endian = self._endian_from_dtype(dt) buf = self.file.read(sz) arr = np.ndarray(shape=shape, @@ -302,7 +302,7 @@ def fort_read(self, dt, shape=-1, endian=None, order=None, head_size=4): if minus_ones == 0: pass elif minus_ones == 1: - known_dimensions_size = -np.product(shape,axis=0) * dt.itemsize + known_dimensions_size = -np.prod(shape,axis=0) * dt.itemsize unknown_dimension_size, illegal = divmod(header, known_dimensions_size) if illegal: @@ -311,7 +311,7 @@ def fort_read(self, dt, shape=-1, endian=None, order=None, head_size=4): else: raise ValueError( "illegal -1 count; can only specify one unknown dimension") - sz = dt.itemsize * np.product(shape) + sz = dt.itemsize * np.prod(shape) buf = self.file.read(sz) arr = np.ndarray(shape=shape,