Skip to content

Commit a84654a

Browse files
committed
Merge pull request matplotlib#2426 from mdboom/testing/remove-dead-rms-computation
Remove dead rms computation
2 parents 26b18e2 + 0bc1568 commit a84654a

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

lib/matplotlib/testing/compare.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -306,32 +306,6 @@ def compare_images( expected, actual, tol, in_decorator=False ):
306306
expected_version = version.LooseVersion("1.6")
307307
found_version = version.LooseVersion(np.__version__)
308308

309-
# On Numpy 1.6, we can use bincount with minlength, which is much faster than
310-
# using histogram
311-
if found_version >= expected_version:
312-
rms = 0
313-
314-
for i in xrange(0, 3):
315-
h1p = expectedImage[:,:,i]
316-
h2p = actualImage[:,:,i]
317-
318-
h1h = np.bincount(h1p.ravel(), minlength=256)
319-
h2h = np.bincount(h2p.ravel(), minlength=256)
320-
321-
rms += np.sum(np.power((h1h-h2h), 2))
322-
else:
323-
rms = 0
324-
ns = np.arange(257)
325-
326-
for i in xrange(0, 3):
327-
h1p = expectedImage[:,:,i]
328-
h2p = actualImage[:,:,i]
329-
330-
h1h = np.histogram(h1p, bins=ns)[0]
331-
h2h = np.histogram(h2p, bins=ns)[0]
332-
333-
rms += np.sum(np.power((h1h-h2h), 2))
334-
335309
rms = calculate_rms(expectedImage, actualImage)
336310

337311
diff_image = make_test_filename(actual, 'failed-diff')

0 commit comments

Comments
 (0)