Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23b03aa

Browse files
committed
testing/compare: Remove "retry ignoring pixels with differences of only 1."
This was introduced in 1283feb, presumably to hack around the fact that 1-pixel differences can make a very large error value. This is not necessary any more, since the root cause has been fixed."
1 parent c855310 commit 23b03aa

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

lib/matplotlib/testing/compare.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -319,21 +319,6 @@ def compare_images( expected, actual, tol, in_decorator=False ):
319319
os.unlink(diff_image)
320320
return None
321321

322-
# For Agg-rendered images, we can retry by ignoring pixels with
323-
# differences of only 1
324-
if extension == 'png':
325-
# Remove differences of only 1
326-
diffImage = np.abs(np.asarray(actualImage, dtype=np.int) -
327-
np.asarray(expectedImage, dtype=np.int))
328-
actualImage = np.where(diffImage <= 1, expectedImage, actualImage)
329-
330-
rms = calculate_rms(expectedImage, actualImage)
331-
332-
if ( (rms / 10000.0) <= tol ):
333-
if os.path.exists(diff_image):
334-
os.unlink(diff_image)
335-
return None
336-
337322
save_diff_image( expected, actual, diff_image )
338323

339324
if in_decorator:

0 commit comments

Comments
 (0)