1111#=======================================================================
1212
1313__all__ = [
14- 'compareFloat ' ,
15- 'compareImages ' ,
14+ 'compare_float ' ,
15+ 'compare_images ' ,
1616 ]
1717
1818#-----------------------------------------------------------------------
19- def compareFloat ( expected , actual , relTol = None , absTol = None ):
19+ def compare_float ( expected , actual , relTol = None , absTol = None ):
2020 """Fail if the floating point values are not close enough, with
2121 the givem message.
2222
@@ -72,15 +72,15 @@ def compareFloat( expected, actual, relTol = None, absTol = None ):
7272 return None
7373
7474#-----------------------------------------------------------------------
75- def compareImages ( expected , actual , tol ):
75+ def compare_images ( expected , actual , tol ):
7676 '''Compare two image files - not the greatest, but fast and good enough.
7777
7878 = EXAMPLE
7979
8080 # img1 = "./baseline/plot.png"
8181 # img2 = "./output/plot.png"
8282 #
83- # compareImage ( img1, img2, 0.001 ):
83+ # compare_images ( img1, img2, 0.001 ):
8484
8585 = INPUT VARIABLES
8686 - expected The filename of the expected image.
@@ -116,7 +116,7 @@ def compareImages( expected, actual, tol ):
116116 else :
117117 diff_image = os .path .join (os .path .dirname (actual ),
118118 'failed-diff-' + os .path .basename (actual ))
119- saveDiffImage ( expected , actual , diff_image )
119+ save_diff_image ( expected , actual , diff_image )
120120
121121 msg = " Error: Image files did not match.\n " \
122122 " RMS Value: " + str ( rms / 10000.0 ) + "\n " \
@@ -126,7 +126,7 @@ def compareImages( expected, actual, tol ):
126126 " Tolerance: " + str ( tol ) + "\n "
127127 return msg
128128
129- def saveDiffImage ( expected , actual , output ):
129+ def save_diff_image ( expected , actual , output ):
130130 from PIL import Image
131131 expectedImage = np .array (Image .open ( expected ).convert ("RGB" )).astype (np .float )
132132 actualImage = np .array (Image .open ( actual ).convert ("RGB" )).astype (np .float )
0 commit comments