From 9bba57305cca3a512720c968d68b1ba2260e3319 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 6 Aug 2012 11:41:45 -0400 Subject: [PATCH 1/2] Document how test caching works --- lib/matplotlib/testing/compare.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/testing/compare.py b/lib/matplotlib/testing/compare.py index 55d13b7a178c..5157a8fd425e 100644 --- a/lib/matplotlib/testing/compare.py +++ b/lib/matplotlib/testing/compare.py @@ -174,8 +174,13 @@ def comparable_formats(): def convert(filename, cache): ''' - Convert the named file into a png file. - Returns the name of the created file. + Convert the named file into a png file. Returns the name of the + created file. + + If *cache* is True, the result of the conversion is cached in + `~/.matplotlib/test_cache/`. The caching is based on a hash of the + exact contents of the input file. The is no limit on the size of + the cache, so it may need to be manually cleared periodically. ''' base, extension = filename.rsplit('.', 1) if extension not in converter: From 9229a5c9b26a663e1596981879f5119dba4cefbc Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 6 Aug 2012 11:41:56 -0400 Subject: [PATCH 2/2] Completely remove some commented out code. --- lib/matplotlib/testing/compare.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/matplotlib/testing/compare.py b/lib/matplotlib/testing/compare.py index 5157a8fd425e..abd4f4f7a953 100644 --- a/lib/matplotlib/testing/compare.py +++ b/lib/matplotlib/testing/compare.py @@ -283,10 +283,6 @@ def compare_images( expected, actual, tol, in_decorator=False ): actualImage, expectedImage = crop_to_same(actual, actualImage, expected, expectedImage) - # normalize the images - # expectedImage = image_util.autocontrast( expectedImage, 2 ) - # actualImage = image_util.autocontrast( actualImage, 2 ) - # compare the resulting image histogram functions expected_version = version.LooseVersion("1.6") found_version = version.LooseVersion(np.__version__)