22import cv2
33import os
44import numpy as np
5- from plantcv .plantcv .visualize . pixel_scatter_vis import pixel_scatter_plot
5+ from plantcv .plantcv .visualize import pixel_scatter_plot
66
77
8- @pytest .mark .parametrize ("ch" , ['R' , 'G' , 'B' , 'l' , 'a' , 'b' , 'h' , 's' , 'v' , 'gray' ])
8+ @pytest .mark .parametrize ("ch" , ['R' , 'G' , 'B' , 'l' , 'a' , 'b' , 'h' , 's' , 'v' , 'c' , 'm' , 'y' , 'k' , ' gray' ])
99def test_pixel_scatter_plot (ch , tmpdir ):
1010 """Test for PlantCV."""
1111 # Create a tmp directory
1212 cache_dir = tmpdir .mkdir ("cache" )
1313 rng = np .random .default_rng ()
14- img_size = (10 ,10 ,3 )
14+ img_size = (10 , 10 , 3 )
1515 # create a random image and write it to the temp directory
1616 img = rng .integers (low = 0 , high = 255 , size = img_size , dtype = np .uint8 , endpoint = True )
1717 path_to_img = os .path .join (cache_dir , 'tmp_img.png' )
@@ -26,12 +26,11 @@ def test_pixel_scatter_plot_wrong_ch(tmpdir):
2626 # Create a tmp directory
2727 cache_dir = tmpdir .mkdir ("cache" )
2828 rng = np .random .default_rng ()
29- img_size = (10 ,10 ,3 )
29+ img_size = (10 , 10 , 3 )
3030 # create a random image and write it to the temp directory
3131 img = rng .integers (low = 0 , high = 255 , size = img_size , dtype = np .uint8 , endpoint = True )
3232 path_to_img = os .path .join (cache_dir , 'tmp_img.png' )
3333 cv2 .imwrite (path_to_img , img )
3434 # test the function with channel parameter that is not an option
3535 with pytest .raises (RuntimeError ):
3636 _ , _ = pixel_scatter_plot (paths_to_imgs = [path_to_img ], x_channel = 'wrong_ch' , y_channel = 'index' )
37-
0 commit comments