def test_multiply_operation_sparse_input_fakeghost_four(self): print("\n test_multiply_operation_sparse_input_fakeghost_four...") v_output = vc.multiply(input_svar, scalar=5, fakeghost=4, make_float32=False) d_output = input_svar * 5 msgs = "test_multiply_operation_sparse_input_fakeghost_four" self.assertTrue((d_output == v_output).all(), msg=msgs)
def test_multiply_operation_sparse_input_blocks_ten(self): print("\n test_multiply_operation_sparse_input_blocks_ten...") v_output = vc.multiply(input_svar, scalar=5, no_of_blocks=10, make_float32=False) d_output = input_svar * 5 msgs = "test_multiply_operation_sparse_input_blocks_ten" self.assertTrue((d_output == v_output).all(), msg=msgs)
def test_multiply_operation_dense_input_fakeghost_one(self): print("\n test_multiply_operation_dense_input_fakeghost_one...") v_output = vc.multiply(input_dvar, scalar=5, fakeghost=1, make_float32=False) d_output = input_dvar * 5 msgs = "test_multiply_operation_dense_input_fakeghost_one" self.assertTrue((d_output == v_output).all(), msg=msgs)
def __test_multiply_operation(self,input_var): print("\n multiply Voxel testing...") start_time = t.time() v_output = vc.multiply(input_var,scalar=5,no_of_blocks=PL[0],fakeghost=PL[1],make_float32=False) print("multiply Voxel testing time taken: ",(t.time() - start_time)," sec") #print("\n multiply Default testing...") start_time = t.time() d_output = input_var*5 print("multiply Default testing time taken: ",(t.time() - start_time)," sec") msgs = "multiply_operation_FAIL_with parameters: scalar=5, ",PL self.assertTrue((d_output==v_output).all(), msg=msgs)
d = ndimage.white_tophat(input_var, size=None, footprint=None, structure=structure, output=None, mode='reflect', cval=0.0, origin=0) print("scipy white_tophat: ", (t.time() - start_time), " sec") print("\nresult: ", (d == output).all()) #16.multiply.............. print("\nmultiply VoxelProcessing") start_time = t.time() output = vc.multiply(input_var, make_float32=False, no_of_blocks=7, fakeghost=2, scalar=10) print("vc multiply: ", (t.time() - start_time), " sec") print("\nmultiply Default") start_time = t.time() d = input_var * 10 print("scipy multiply: ", (t.time() - start_time), " sec") print("\nresult: ", (d == output).all()) # # print(output[134][156][98]) # # print(d[134][156][98]) # # t = np.setdiff1d(output, d) # # print(len(t))
def test_multiply_operation_sparse_input_scalar_float(self): print("\n test_multiply_operation_sparse_input_scalar_float...") v_output = vc.multiply(input_svar, scalar=5.5, make_float32=False) d_output = input_svar * 5.5 msgs = "test_multiply_operation_sparse_input_scalar_float" self.assertTrue((d_output == v_output).all(), msg=msgs)
size=None, footprint=None, structure=structure, output=None, mode='reflect', cval=0.0, origin=0) #15 output_var = vc.white_tophat(input_var, no_of_blocks=4, fakeghost=2, make_float32=True, size=None, footprint=None, structure=structure, output=None, mode='reflect', cval=0.0, origin=0) #16 output_var = vc.multiply(input_var, no_of_blocks=4, fakeghost=2, make_float32=True, scalar=1) #17 output_var = vc.nothing(input_var, no_of_blocks=4, fakeghost=2, make_float32=True)