new name
'prod' was introduced in numpy 1.7, 'product' will be removed in 2.0
This commit is contained in:
parent
36c13d2e58
commit
ee4cfe4b24
|
@ -326,7 +326,7 @@ class TestResult:
|
||||||
if shape == 'pseudo_scalar': default.add_calculation('#F#[:,0,0:1]','x','1','a pseudo scalar')
|
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 == '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')
|
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')
|
default.add_gradient('x')
|
||||||
in_file = default.place('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)
|
in_memory = grid_filters.gradient(default.size,x.reshape(tuple(default.cells)+x.shape[1:])).reshape(in_file.shape)
|
||||||
|
|
|
@ -398,7 +398,7 @@ class TestGridFilters:
|
||||||
np.arange(cells[1]),
|
np.arange(cells[1]),
|
||||||
np.arange(cells[2]),indexing='ij')).reshape(tuple(cells)+(3,),order='F')
|
np.arange(cells[2]),indexing='ij')).reshape(tuple(cells)+(3,),order='F')
|
||||||
x,y,z = map(np.random.randint,cells)
|
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):
|
def test_unravel_index(self):
|
||||||
cells = np.random.randint(8,32,(3))
|
cells = np.random.randint(8,32,(3))
|
||||||
|
|
Loading…
Reference in New Issue