#NEWLINE# def test_convert_patches_list_to_single_array( ) : #NEWLINE# #INDENT# patch_shape = ( 7 , 2 ) #NEWLINE# n_channels = 10 #NEWLINE# n_centers = 2 #NEWLINE# n_offsets = 2 #NEWLINE# patches_list = [ Image ( ( 1 * np . ones ( ( ( n_channels , ) + patch_shape ) ) ) ) , Image ( ( 2 * np . ones ( ( ( n_channels , ) + patch_shape ) ) ) ) , Image ( ( 3 * np . ones ( ( ( n_channels , ) + patch_shape ) ) ) ) , Image ( ( 4 * np . ones ( ( ( n_channels , ) + patch_shape ) ) ) ) ] #NEWLINE# patches_array = np . zeros ( ( ( n_centers , n_offsets , n_channels ) + patch_shape ) ) #NEWLINE# patches_array [ ( 0 , 0 , ... ) ] = patches_list [ 0 ] . pixels #NEWLINE# patches_array [ ( 0 , 1 , ... ) ] = patches_list [ 1 ] . pixels #NEWLINE# patches_array [ ( 1 , 0 , ... ) ] = patches_list [ 2 ] . pixels #NEWLINE# patches_array [ ( 1 , 1 , ... ) ] = patches_list [ 3 ] . pixels #NEWLINE# assert_array_equal ( _convert_patches_list_to_single_array ( patches_list , n_centers ) , patches_array )