From ee4cfe4b24db49c832fbd27cac2f14159d7667b7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 22 Sep 2023 10:58:46 +0200 Subject: [PATCH] new name 'prod' was introduced in numpy 1.7, 'product' will be removed in 2.0 --- python/tests/test_Result.py | 2 +- python/tests/test_grid_filters.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index a775e1c2d..8b92238ae 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -326,7 +326,7 @@ class TestResult: if shape == 'pseudo_scalar': default.add_calculation('#F#[:,0,0:1]','x','1','a pseudo scalar') if shape == 'scalar': default.add_calculation('#F#[:,0,0]','x','1','just a scalar') if shape == 'vector': default.add_calculation('#F#[:,:,1]','x','1','just a vector') - x = default.place('x').reshape((np.product(default.cells),-1)) + x = default.place('x').reshape((np.prod(default.cells),-1)) default.add_gradient('x') in_file = default.place('gradient(x)') in_memory = grid_filters.gradient(default.size,x.reshape(tuple(default.cells)+x.shape[1:])).reshape(in_file.shape) diff --git a/python/tests/test_grid_filters.py b/python/tests/test_grid_filters.py index 20575f2bd..d19bf03e9 100644 --- a/python/tests/test_grid_filters.py +++ b/python/tests/test_grid_filters.py @@ -398,7 +398,7 @@ class TestGridFilters: np.arange(cells[1]), np.arange(cells[2]),indexing='ij')).reshape(tuple(cells)+(3,),order='F') x,y,z = map(np.random.randint,cells) - assert grid_filters.ravel_index(indices)[x,y,z] == np.arange(0,np.product(cells)).reshape(cells,order='F')[x,y,z] + assert grid_filters.ravel_index(indices)[x,y,z] == np.arange(0,np.prod(cells)).reshape(cells,order='F')[x,y,z] def test_unravel_index(self): cells = np.random.randint(8,32,(3))