#NEWLINE# def test_single_ndarray_patch( ) : #NEWLINE# #INDENT# patch_shape = ( 21 , 7 ) #NEWLINE# n_channels = 4 #NEWLINE# im = Image . init_blank ( patch_shape , n_channels ) #NEWLINE# patch = np . zeros ( ( ( 2 , 2 , n_channels ) + patch_shape ) ) #NEWLINE# patch [ ( 1 , 0 , ... ) ] = np . ones ( ( ( n_channels , ) + patch_shape ) ) #NEWLINE# patch [ ( 1 , 1 , ... ) ] = ( 2 * np . ones ( ( ( n_channels , ) + patch_shape ) ) ) #NEWLINE# patch_center = PointCloud ( np . array ( [ [ 10.0 , 3.0 ] , [ 11.0 , 3.0 ] ] ) ) #NEWLINE# im . set_patches ( patch , patch_center , offset = ( 0 , 0 ) , offset_index = 1 ) #NEWLINE# res = np . zeros ( patch_shape ) #NEWLINE# res [ 1 : ( - 1 ) , : ] = 2 #NEWLINE# assert_array_equal ( im . pixels [ ( 2 , ... ) ] , res )