diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index 8dcc0e136c..4d029104a8 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -34,13 +34,16 @@ from six.moves import (filter, input, map, range, zip) # noqa import six +import codecs import collections import contextlib import difflib import filecmp import functools import gzip +import hashlib import inspect +import json import io import logging import os @@ -620,16 +623,21 @@ def _unique_id(self): """ # Obtain a consistent ID for the current test. - # NB. unittest.TestCase.id() returns different values depending on # whether the test has been run explicitly, or via test discovery. # For example: # python tests/test_plot.py => '__main__.TestContourf.test_tx' # ird -t => 'iris.tests.test_plot.TestContourf.test_tx' - bits = self.id().split('.')[-3:] + bits = self.id().split('.') if bits[0] == '__main__': - file_name = os.path.basename(sys.modules['__main__'].__file__) + floc = sys.modules['__main__'].__file__ + path, file_name = os.path.split(os.path.abspath(floc)) bits[0] = os.path.splitext(file_name)[0] + folder, location = os.path.split(path) + bits = [location] + bits + while location != 'iris': + folder, location = os.path.split(folder) + bits = [location] + bits test_id = '.'.join(bits) # Derive the sequential assertion ID within the test @@ -652,21 +660,22 @@ def _ensure_folder(self, path): logger.warning('Creating folder: %s', dir_path) os.makedirs(dir_path) - def check_graphic(self, tol=_DEFAULT_IMAGE_TOLERANCE): - """Checks the CRC matches for the current matplotlib.pyplot figure, and closes the figure.""" + def check_graphic(self, tol=None): + """ + Checks the CRC matches for the current matplotlib.pyplot figure, + and closes the figure. + + """ unique_id = self._unique_id() figure = plt.gcf() + + repo_fname = os.path.join(os.path.dirname(__file__), 'results', 'imagerepo.json') + with open(repo_fname, 'rb') as fi: + repo = json.load(codecs.getreader('utf-8')(fi)) try: - expected_fname = os.path.join(os.path.dirname(__file__), - 'results', 'visual_tests', - unique_id + '.png') - - if not os.path.isdir(os.path.dirname(expected_fname)): - os.makedirs(os.path.dirname(expected_fname)) - #: The path where the images generated by the tests should go. image_output_directory = os.path.join(os.path.dirname(__file__), 'result_image_comparison') @@ -695,18 +704,38 @@ def check_graphic(self, tol=_DEFAULT_IMAGE_TOLERANCE): figure.savefig(result_fname) - if not os.path.exists(expected_fname): - warnings.warn('Created image for test %s' % unique_id) - shutil.copy2(result_fname, expected_fname) + # XXX: Deal with a new test result i.e. it's not in the repo - err = mcompare.compare_images(expected_fname, result_fname, tol=tol) + # hash the created image using sha1 + with open(result_fname, 'rb') as res_file: + sha1 = hashlib.sha1(res_file.read()) + if unique_id not in repo: + wmsg = 'Created image {} for test {}.' + warnings.warn(wmsg.format(result_fname, unique_id)) + else: + uris = repo[unique_id] + # Cherry-pick the registered expected hashes from the + # test case uri/s. + expected = [os.path.splitext(os.path.basename(uri))[0] + for uri in uris] + + if sha1.hexdigest() not in expected: + emsg = 'Actual SHA1 {} not in expected {} for test {}.' + emsg = emsg.format(sha1.hexdigest(), expected, unique_id) + if _DISPLAY_FIGURES: + print('Image comparison would have failed. ' + 'Message: %s' % emsg) + else: + raise ValueError('Image comparison failed.' + ' Message: %s' % emsg) + else: + # There is no difference between the actual and expected + # result, so remove the actual result file. + os.remove(result_fname) + if _DISPLAY_FIGURES: - if err: - print('Image comparison would have failed. Message: %s' % err) plt.show() - else: - assert not err, 'Image comparison failed. Message: %s' % err finally: plt.close() diff --git a/lib/iris/tests/results/imagerepo.json b/lib/iris/tests/results/imagerepo.json new file mode 100644 index 0000000000..9daad11f23 --- /dev/null +++ b/lib/iris/tests/results/imagerepo.json @@ -0,0 +1,661 @@ +{ + "example_tests.test_COP_1d_plot.TestCOP1DPlot.test_COP_1d_plot.0": [ + "https://scitools.github.io/test-images-scitools/image_files/775b9dec3549e46f9671f79899f09f5c42870b0c.png" + ], + "example_tests.test_COP_maps.TestCOPMaps.test_cop_maps.0": [ + "https://scitools.github.io/test-images-scitools/image_files/4da9442a24056728296b6637f062f42a9cd6ee06.png", + "https://scitools.github.io/test-images-scitools/image_files/14505f4a4c2fdb306751de8bacfac6b44dadee85.png" + ], + "example_tests.test_SOI_filtering.TestSOIFiltering.test_soi_filtering.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c998a36d81d38745ab2513af5450a39494edb2af.png" + ], + "example_tests.test_TEC.TestTEC.test_TEC.0": [ + "https://scitools.github.io/test-images-scitools/image_files/463935ede08ceddadcc24324e0a11c24fb46a0c8.png" + ], + "example_tests.test_anomaly_log_colouring.TestAnomalyLogColouring.test_anomaly_log_colouring.0": [ + "https://scitools.github.io/test-images-scitools/image_files/19db1152a859567b0bf9fe89a7d1880acafbf100.png", + "https://scitools.github.io/test-images-scitools/image_files/6e2454e989a05be593bd1082f905a9fd46c2049a.png" + ], + "example_tests.test_atlantic_profiles.TestAtlanticProfiles.test_atlantic_profiles.0": [ + "https://scitools.github.io/test-images-scitools/image_files/0bde47fbbc4a15498c0ecb8bd3eb5e63339e5121.png" + ], + "example_tests.test_atlantic_profiles.TestAtlanticProfiles.test_atlantic_profiles.1": [ + "https://scitools.github.io/test-images-scitools/image_files/ddc7f58664e61c5798ecfc7e55ec3c6c62ab1a24.png" + ], + "example_tests.test_coriolis_plot.TestCoriolisPlot.test_coriolis_plot.0": [ + "https://scitools.github.io/test-images-scitools/image_files/7576971ae4fce5456c67c5d54f3f4110d6e85e13.png", + "https://scitools.github.io/test-images-scitools/image_files/fb246b208d11834e8108067504c6a73ee05f85ee.png" + ], + "example_tests.test_cross_section.TestCrossSection.test_cross_section.0": [ + "https://scitools.github.io/test-images-scitools/image_files/7b5c6d7466e953e845d0bc1ec9f08b01471b87ee.png" + ], + "example_tests.test_cross_section.TestCrossSection.test_cross_section.1": [ + "https://scitools.github.io/test-images-scitools/image_files/3589f5e242ce5b565b74da23287fddec32d102fa.png" + ], + "example_tests.test_custom_aggregation.TestCustomAggregation.test_custom_aggregation.0": [ + "https://scitools.github.io/test-images-scitools/image_files/3fd959e6f86fbe99ff0fa9fb06d5af48edde69a6.png", + "https://scitools.github.io/test-images-scitools/image_files/53e6e605d77d92b7a565a05b94fbe71b0884dcfe.png" + ], + "example_tests.test_custom_file_loading.TestCustomFileLoading.test_custom_file_loading.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c903e396c04a4d1076767c8474b1e48c80413aab.png" + ], + "example_tests.test_deriving_phenomena.TestDerivingPhenomena.test_deriving_phenomena.0": [ + "https://scitools.github.io/test-images-scitools/image_files/4f6ee4c1ad1b3fa3c5d31ddeba34c8ec544fed50.png" + ], + "example_tests.test_global_map.TestGlobalMap.test_global_map.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c4193550f97b1384419c0761ba85304012638ce8.png", + "https://scitools.github.io/test-images-scitools/image_files/0d370726237672639b01eda6795297af1e7153d3.png" + ], + "example_tests.test_hovmoller.TestGlobalMap.test_hovmoller.0": [ + "https://scitools.github.io/test-images-scitools/image_files/6de52bb3dc3838802c87fedfcdd3db585bae4ccf.png" + ], + "example_tests.test_inset_plot.TestInsetPlot.test_inset_plot.0": [ + "https://scitools.github.io/test-images-scitools/image_files/a4d290bab6da123ef455b39979f415debb2b925c.png" + ], + "example_tests.test_lagged_ensemble.TestLaggedEnsemble.test_lagged_ensemble.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c23632eba452a7c3074396c288ddc85cf9a27923.png", + "https://scitools.github.io/test-images-scitools/image_files/ed98c2a750eae4f06b269c38ca3810ce9eb51c38.png" + ], + "example_tests.test_lagged_ensemble.TestLaggedEnsemble.test_lagged_ensemble.1": [ + "https://scitools.github.io/test-images-scitools/image_files/2aae63c8a7581a0a84c3ec3df73cf96a3afa6cda.png" + ], + "example_tests.test_lineplot_with_legend.TestLineplotWithLegend.test_lineplot_with_legend.0": [ + "https://scitools.github.io/test-images-scitools/image_files/f4d65c3ff5b1c11617479af2977279f3b9c743bd.png" + ], + "example_tests.test_orca_projection.TestOrcaProjection.test_orca_projection.0": [ + "https://scitools.github.io/test-images-scitools/image_files/31770e35ff8b5d35be3d167362ad3beed4ab9bde.png" + ], + "example_tests.test_orca_projection.TestOrcaProjection.test_orca_projection.1": [ + "https://scitools.github.io/test-images-scitools/image_files/12e559666b9116918c861fe09ddcf989f35699d4.png" + ], + "example_tests.test_orca_projection.TestOrcaProjection.test_orca_projection.2": [ + "https://scitools.github.io/test-images-scitools/image_files/eef5b0eb8018eb07bbf9457c0641d062baa289a7.png", + "https://scitools.github.io/test-images-scitools/image_files/b97f483476f3006f83886fd6746a38193b65a16f.png" + ], + "example_tests.test_orca_projection.TestOrcaProjection.test_orca_projection.3": [ + "https://scitools.github.io/test-images-scitools/image_files/76a40975b3e35f8226c37be146ad6fc678eea13a.png" + ], + "example_tests.test_polar_stereo.TestPolarStereo.test_polar_stereo.0": [ + "https://scitools.github.io/test-images-scitools/image_files/889b91c7a5ff2403e24dce5047e95dc7eec7efe7.png", + "https://scitools.github.io/test-images-scitools/image_files/9dc8f0fb0201cca91dd00f0ede59c326f0d8a8f4.png" + ], + "example_tests.test_polynomial_fit.TestPolynomialFit.test_polynomial_fit.0": [ + "https://scitools.github.io/test-images-scitools/image_files/63876535ed13433a906cd08480032b741194e326.png" + ], + "example_tests.test_projections_and_annotations.TestProjectionsAndAnnotations.test_projections_and_annotations.0": [ + "https://scitools.github.io/test-images-scitools/image_files/2e6dffe8498e3d961e4f91d9a4fd796c537204a6.png" + ], + "example_tests.test_projections_and_annotations.TestProjectionsAndAnnotations.test_projections_and_annotations.1": [ + "https://scitools.github.io/test-images-scitools/image_files/3107cb6d9c75ad3f78a30a0657427cebd7239c63.png" + ], + "example_tests.test_rotated_pole_mapping.TestRotatedPoleMapping.test_rotated_pole_mapping.0": [ + "https://scitools.github.io/test-images-scitools/image_files/8b0a45dad08dffcd7fbcef60ca847d6193f0990b.png" + ], + "example_tests.test_rotated_pole_mapping.TestRotatedPoleMapping.test_rotated_pole_mapping.1": [ + "https://scitools.github.io/test-images-scitools/image_files/6f59adaf0345b659549a8e4429776bb3ccc72eb5.png" + ], + "example_tests.test_rotated_pole_mapping.TestRotatedPoleMapping.test_rotated_pole_mapping.2": [ + "https://scitools.github.io/test-images-scitools/image_files/b1337a8c553127842a7dcb56eb45eb6dd332b9c0.png" + ], + "example_tests.test_rotated_pole_mapping.TestRotatedPoleMapping.test_rotated_pole_mapping.3": [ + "https://scitools.github.io/test-images-scitools/image_files/d369be63c5fae9796bf7e5be812347e84e7856b7.png" + ], + "example_tests.test_wind_speed.TestWindSpeed.test_wind_speed.0": [ + "https://scitools.github.io/test-images-scitools/image_files/b0686cad2a2b5f522f7d00a97e84c1362ccf6aff.png" + ], + "example_tests.test_wind_speed.TestWindSpeed.test_wind_speed.1": [ + "https://scitools.github.io/test-images-scitools/image_files/315f0ed273e0a806cf5f4526c2fec51c528e721f.png" + ], + "iris.tests.experimental.test_animate.IntegrationTest.test_cube_animation.0": [ + "https://scitools.github.io/test-images-scitools/image_files/617b8b23a9df4829e085772ea92e44642e2128e8.png" + ], + "iris.tests.experimental.test_animate.IntegrationTest.test_cube_animation.1": [ + "https://scitools.github.io/test-images-scitools/image_files/807be711fd047fbde8b49d2262614b93bd392eef.png" + ], + "iris.tests.experimental.test_animate.IntegrationTest.test_cube_animation.2": [ + "https://scitools.github.io/test-images-scitools/image_files/be7ca725fd9003151265478e426a612a5b65b901.png" + ], + "iris.tests.test_analysis.TestProject.test_cartopy_projection.0": [ + "https://scitools.github.io/test-images-scitools/image_files/35abe0d7038a75580aac6bbde6045213ba0f2509.png" + ], + "iris.tests.test_analysis.TestRotatedPole.test_all.0": [ + "https://scitools.github.io/test-images-scitools/image_files/66ed0f9d1ef83b714fda7299264e6c420ca04159.png" + ], + "iris.tests.test_analysis.TestRotatedPole.test_all.1": [ + "https://scitools.github.io/test-images-scitools/image_files/30570614007e1f55df68f04b37e348c46a9a20b9.png" + ], + "iris.tests.test_analysis.TestRotatedPole.test_all.2": [ + "https://scitools.github.io/test-images-scitools/image_files/0f5c99da44a0f4640374961907f324a5dac767eb.png", + "https://scitools.github.io/test-images-scitools/image_files/6b5e42fc27c146b1e5e6b6e57b7d4dce0891463b.png" + ], + "iris.tests.test_analysis.TestRotatedPole.test_all.3": [ + "https://scitools.github.io/test-images-scitools/image_files/27e9a9ca84937d9b13ba997cfbc6f461c925b20d.png" + ], + "iris.tests.test_mapping.TestBasic.test_contourf.0": [ + "https://scitools.github.io/test-images-scitools/image_files/144c741aead354b149cb838df59b9db6c179f22b.png" + ], + "iris.tests.test_mapping.TestBasic.test_pcolor.0": [ + "https://scitools.github.io/test-images-scitools/image_files/597727cac62033e69449cd1df51442b00600d044.png" + ], + "iris.tests.test_mapping.TestBasic.test_unmappable.0": [ + "https://scitools.github.io/test-images-scitools/image_files/cd0806eafb5b42d2ee4b58bbe0ec4a9acc31b2f8.png" + ], + "iris.tests.test_mapping.TestBoundedCube.test_grid.0": [ + "https://scitools.github.io/test-images-scitools/image_files/a13f5471b13c6ee588d12e826397b2ca95957de8.png", + "https://scitools.github.io/test-images-scitools/image_files/e7f0d9d512e15dc173a04ccd527643f6cde456e8.png" + ], + "iris.tests.test_mapping.TestBoundedCube.test_pcolormesh.0": [ + "https://scitools.github.io/test-images-scitools/image_files/b565f8a9ce5b591c734db50342dc8d56715aa747.png" + ], + "iris.tests.test_mapping.TestLimitedAreaCube.test_grid.0": [ + "https://scitools.github.io/test-images-scitools/image_files/edd8ff73460d9550e3314b2bb557a825d14c3297.png" + ], + "iris.tests.test_mapping.TestLimitedAreaCube.test_outline.0": [ + "https://scitools.github.io/test-images-scitools/image_files/e0c2ae53c64f2ed1b15dc7cb7c3651245358f390.png" + ], + "iris.tests.test_mapping.TestLimitedAreaCube.test_pcolormesh.0": [ + "https://scitools.github.io/test-images-scitools/image_files/d81f45733e18b59f9c406c24f317f17541206a31.png" + ], + "iris.tests.test_mapping.TestLimitedAreaCube.test_scatter.0": [ + "https://scitools.github.io/test-images-scitools/image_files/4bc661c638c6a9efbfd7fe86bcecc374f8346ba4.png" + ], + "iris.tests.test_mapping.TestLowLevel.test_keywords.0": [ + "https://scitools.github.io/test-images-scitools/image_files/35df96c086fb2fd3d9caf6fb83f4d60ec374d911.png" + ], + "iris.tests.test_mapping.TestLowLevel.test_keywords.1": [ + "https://scitools.github.io/test-images-scitools/image_files/1889a8bc69e1bb2aff055a15502254750f75f49b.png" + ], + "iris.tests.test_mapping.TestLowLevel.test_params.0": [ + "https://scitools.github.io/test-images-scitools/image_files/56e43bfbdd03403311ebb360a61555f95109f77e.png" + ], + "iris.tests.test_mapping.TestLowLevel.test_params.1": [ + "https://scitools.github.io/test-images-scitools/image_files/35df96c086fb2fd3d9caf6fb83f4d60ec374d911.png" + ], + "iris.tests.test_mapping.TestLowLevel.test_params.2": [ + "https://scitools.github.io/test-images-scitools/image_files/09ff363a1480723718fb45a3ee00cd96d381af03.png" + ], + "iris.tests.test_mapping.TestLowLevel.test_simple.0": [ + "https://scitools.github.io/test-images-scitools/image_files/daa3fdca43751f47850fede89dd7cee264869a56.png" + ], + "iris.tests.test_mapping.TestMappingSubRegion.test_simple.0": [ + "https://scitools.github.io/test-images-scitools/image_files/ca5c4ee2e91cb93ac7c4fd1d26b2a82782d8889c.png", + "https://scitools.github.io/test-images-scitools/image_files/3fe974f3e046169628361621901cc9a1598ff339.png" + ], + "iris.tests.test_mapping.TestUnmappable.test_simple.0": [ + "https://scitools.github.io/test-images-scitools/image_files/6c139dab88d9e5884d313f1a607de5e9c4fe5a93.png" + ], + "iris.tests.test_plot.Test1dPlotMultiArgs.test_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/5aa8117fa9dc96301a1228ca474ea9aa33a12bc0.png" + ], + "iris.tests.test_plot.Test1dPlotMultiArgs.test_coord_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/b74ae4b75a5170367fe2e796ccf4898eae52b414.png" + ], + "iris.tests.test_plot.Test1dPlotMultiArgs.test_coord_coord_map.0": [ + "https://scitools.github.io/test-images-scitools/image_files/d19ccf44440ea05d2194498aa777ba1360093a1f.png" + ], + "iris.tests.test_plot.Test1dPlotMultiArgs.test_coord_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/da5c4399b8b13a28856f849d33316512a8ede165.png" + ], + "iris.tests.test_plot.Test1dPlotMultiArgs.test_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/19cea174453fe151e0dfd39c11228fda6c9cfee4.png" + ], + "iris.tests.test_plot.Test1dPlotMultiArgs.test_cube_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/94e545eaa00fdd0fe50c26115adf754f2bbca24e.png" + ], + "iris.tests.test_plot.Test1dPlotMultiArgs.test_cube_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/dbca489c3218db86e912f317fe71c57f39df144c.png" + ], + "iris.tests.test_plot.Test1dQuickplotPlotMultiArgs.test_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c7ea0e1e12e3e9bf1b7f2e2c51fb20b174bcad4e.png" + ], + "iris.tests.test_plot.Test1dQuickplotPlotMultiArgs.test_coord_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/74b7de58343ad7d62d8d7ad5f22bc3cc22a4af80.png" + ], + "iris.tests.test_plot.Test1dQuickplotPlotMultiArgs.test_coord_coord_map.0": [ + "https://scitools.github.io/test-images-scitools/image_files/d19ccf44440ea05d2194498aa777ba1360093a1f.png" + ], + "iris.tests.test_plot.Test1dQuickplotPlotMultiArgs.test_coord_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/b1a4d231a7c6253b1caa08a66e19714ae5db7223.png" + ], + "iris.tests.test_plot.Test1dQuickplotPlotMultiArgs.test_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/4340a0484d945f089fa69c7613a1f0b6043fe112.png" + ], + "iris.tests.test_plot.Test1dQuickplotPlotMultiArgs.test_cube_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/fd829406f32eee12a67c2f49c249b7cd6f688982.png" + ], + "iris.tests.test_plot.Test1dQuickplotPlotMultiArgs.test_cube_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/d3a5a78878fbd3ff950154e31777873a1c2e8a8d.png" + ], + "iris.tests.test_plot.Test1dQuickplotScatter.test_coord_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/ed82a70b0c0be29125ed8617170e4dbf70b85ade.png", + "https://scitools.github.io/test-images-scitools/image_files/1fdde24b734abf1af4a37b7ea60b57a3faaf1488.png" + ], + "iris.tests.test_plot.Test1dQuickplotScatter.test_coord_coord_map.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c4b3148593e87a8c3d2b1d572b1b4ae03dd94dbc.png" + ], + "iris.tests.test_plot.Test1dQuickplotScatter.test_coord_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/679e07758bc9c5f7351c3986e8fe62eac2da1a7f.png" + ], + "iris.tests.test_plot.Test1dQuickplotScatter.test_cube_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/a8e1b690b0fc82f84cd1f7059293a87ad24e488a.png", + "https://scitools.github.io/test-images-scitools/image_files/2027525091f6570aa174cace65946c194850da81.png" + ], + "iris.tests.test_plot.Test1dQuickplotScatter.test_cube_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/705b1845dc46f3cee92246ae51b8a4a15c67c863.png" + ], + "iris.tests.test_plot.Test1dScatter.test_coord_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/52d74d1fb0042835b59ab1f4ef561add128bd7ee.png" + ], + "iris.tests.test_plot.Test1dScatter.test_coord_coord_map.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c4b3148593e87a8c3d2b1d572b1b4ae03dd94dbc.png" + ], + "iris.tests.test_plot.Test1dScatter.test_coord_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/233e0e250ef5c2719c96ce7b16c6ed7a0a88091e.png" + ], + "iris.tests.test_plot.Test1dScatter.test_cube_coord.0": [ + "https://scitools.github.io/test-images-scitools/image_files/69f542f0da3bc5412a25bf271335552ca0eb785f.png" + ], + "iris.tests.test_plot.Test1dScatter.test_cube_cube.0": [ + "https://scitools.github.io/test-images-scitools/image_files/3afc7171e4f3aa35bf7f9577ec6e2f1d89aea9d9.png" + ], + "iris.tests.test_plot.TestAttributePositive.test_1d_positive_down.0": [ + "https://scitools.github.io/test-images-scitools/image_files/5db053328dde597011079c185d2a56c37f248e3e.png" + ], + "iris.tests.test_plot.TestAttributePositive.test_1d_positive_up.0": [ + "https://scitools.github.io/test-images-scitools/image_files/4a779f53a265583be6689e8f667c28e59cfaac0d.png" + ], + "iris.tests.test_plot.TestAttributePositive.test_2d_positive_down.0": [ + "https://scitools.github.io/test-images-scitools/image_files/1e7c0a564478517423eea820359b75c153314cbd.png" + ], + "iris.tests.test_plot.TestAttributePositive.test_2d_positive_up.0": [ + "https://scitools.github.io/test-images-scitools/image_files/aed8a66271753fafa072ec951e3fd639f7e038a6.png" + ], + "iris.tests.test_plot.TestContour.test_tx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/ecbddd9552047a1b3b6b0dc33a7d1bb399fe0588.png" + ], + "iris.tests.test_plot.TestContour.test_ty.0": [ + "https://scitools.github.io/test-images-scitools/image_files/e357cd154fb1b164a3525e33977b0e76e34da335.png" + ], + "iris.tests.test_plot.TestContour.test_tz.0": [ + "https://scitools.github.io/test-images-scitools/image_files/633b37b1fba2128d0aec99cb3e3588bfac7a3220.png" + ], + "iris.tests.test_plot.TestContour.test_yx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/8d00c052103838ffeef1cf6b816995f0be0399d7.png" + ], + "iris.tests.test_plot.TestContour.test_zx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/7076696188d3928b351175309a0f9112bc36211e.png" + ], + "iris.tests.test_plot.TestContour.test_zy.0": [ + "https://scitools.github.io/test-images-scitools/image_files/baa6a4ac704a961e93c2333c4294cc6788a1138d.png" + ], + "iris.tests.test_plot.TestContourf.test_tx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/3a3f733ca19bb77f75edc78434e426a0712b4000.png" + ], + "iris.tests.test_plot.TestContourf.test_ty.0": [ + "https://scitools.github.io/test-images-scitools/image_files/7e50729fc9e158c860c05ea49a972c46367ba30c.png" + ], + "iris.tests.test_plot.TestContourf.test_tz.0": [ + "https://scitools.github.io/test-images-scitools/image_files/eb9af9a834557d5eefdf3a49f5eea00b7b4d2e91.png" + ], + "iris.tests.test_plot.TestContourf.test_yx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/0b2acc1d2b501c52340d207483d45f8fc4826c01.png" + ], + "iris.tests.test_plot.TestContourf.test_zx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/3f5dbae7d5380f95e09b58d420374b15617fb182.png" + ], + "iris.tests.test_plot.TestContourf.test_zy.0": [ + "https://scitools.github.io/test-images-scitools/image_files/5e817ab96c8382085f37e78d61ee7998cfa16597.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_bounds.0": [ + "https://scitools.github.io/test-images-scitools/image_files/72d57508c5d53419e5a7fa833159da110843b026.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_bounds.1": [ + "https://scitools.github.io/test-images-scitools/image_files/fce74a970a8ef5cb45ed924f97fdd4ce6dd97a54.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_bounds.2": [ + "https://scitools.github.io/test-images-scitools/image_files/72d57508c5d53419e5a7fa833159da110843b026.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_orography.0": [ + "https://scitools.github.io/test-images-scitools/image_files/2b59e053a13b5968e07607424f03468fda2b695a.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_orography.1": [ + "https://scitools.github.io/test-images-scitools/image_files/092427a8ef17decf87a865e7dd183116b039ac7f.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_points.0": [ + "https://scitools.github.io/test-images-scitools/image_files/87d20ae64afcafd9479aeda97e492f4b67d1159b.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_points.1": [ + "https://scitools.github.io/test-images-scitools/image_files/187bf26afa32f03cf8498285d52fb7b52a8887f2.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_points.2": [ + "https://scitools.github.io/test-images-scitools/image_files/6ad78d87a51a56e5f8cb52ae819ff4a187063a37.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_points.3": [ + "https://scitools.github.io/test-images-scitools/image_files/87d20ae64afcafd9479aeda97e492f4b67d1159b.png" + ], + "iris.tests.test_plot.TestHybridHeight.test_points.4": [ + "https://scitools.github.io/test-images-scitools/image_files/02a257230279e7a43f26af8cb3a00f9e8ce03be0.png" + ], + "iris.tests.test_plot.TestMissingCS.test_missing_cs.0": [ + "https://scitools.github.io/test-images-scitools/image_files/94c6c29a1e6a0378b37df21493e19b2df9f5840e.png", + "https://scitools.github.io/test-images-scitools/image_files/428ca72c04078527fe951bbd73dd23964de02811.png" + ], + "iris.tests.test_plot.TestMissingCoord.test_no_u.0": [ + "https://scitools.github.io/test-images-scitools/image_files/deb931aad496b36dd8b79610352b8a851e5c39d7.png" + ], + "iris.tests.test_plot.TestMissingCoord.test_no_u.1": [ + "https://scitools.github.io/test-images-scitools/image_files/23e45f4ae38676a4643267f901baf23b09ede8b1.png" + ], + "iris.tests.test_plot.TestMissingCoord.test_no_v.0": [ + "https://scitools.github.io/test-images-scitools/image_files/6d93e3bdbd66d8941d60c290d74c9b8c562b804e.png" + ], + "iris.tests.test_plot.TestMissingCoord.test_no_v.1": [ + "https://scitools.github.io/test-images-scitools/image_files/7724dc04c133d21604039cfca06cc41c77092e86.png" + ], + "iris.tests.test_plot.TestMissingCoord.test_none.0": [ + "https://scitools.github.io/test-images-scitools/image_files/b00df556989c9ed0df534bc13f7579c10110d758.png" + ], + "iris.tests.test_plot.TestMissingCoord.test_none.1": [ + "https://scitools.github.io/test-images-scitools/image_files/ddc3ca21a5d6b0447170bb879cf099e137cf47b8.png" + ], + "iris.tests.test_plot.TestPcolor.test_tx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/ed3586eb8646d7255e875dc8d85b16f6eadab639.png" + ], + "iris.tests.test_plot.TestPcolor.test_ty.0": [ + "https://scitools.github.io/test-images-scitools/image_files/f64ba3feb7baeebfa4a660ec361db5dbd6fa5132.png" + ], + "iris.tests.test_plot.TestPcolor.test_tz.0": [ + "https://scitools.github.io/test-images-scitools/image_files/f4b028a5707513cd318edbf8693e806c4d421bfe.png" + ], + "iris.tests.test_plot.TestPcolor.test_yx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/3060c1d145f261b476d0906c9a596e40e45a4bab.png" + ], + "iris.tests.test_plot.TestPcolor.test_zx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/7c6b88aec0be02b3804ccd95cb68325d5d6f327b.png" + ], + "iris.tests.test_plot.TestPcolor.test_zy.0": [ + "https://scitools.github.io/test-images-scitools/image_files/50a2e6837c4d0b055163217b772ad7933ba96bbf.png" + ], + "iris.tests.test_plot.TestPcolorNoBounds.test_tx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/99a94071255af42db0cf41871ce60ef0adf33064.png" + ], + "iris.tests.test_plot.TestPcolorNoBounds.test_ty.0": [ + "https://scitools.github.io/test-images-scitools/image_files/f2e8a2e5adfbc1fb94151fe7899134709e555901.png" + ], + "iris.tests.test_plot.TestPcolorNoBounds.test_tz.0": [ + "https://scitools.github.io/test-images-scitools/image_files/70c36a003abe6a985edc41e65cffdc36953a2355.png" + ], + "iris.tests.test_plot.TestPcolorNoBounds.test_yx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/b822214ce05f8834b435f71552c81d043e257136.png" + ], + "iris.tests.test_plot.TestPcolorNoBounds.test_zx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/1721021e3704965a27a51c41b59c77c8ac73bc01.png" + ], + "iris.tests.test_plot.TestPcolorNoBounds.test_zy.0": [ + "https://scitools.github.io/test-images-scitools/image_files/b348e719432227c2e65d1727d86dea1505646356.png" + ], + "iris.tests.test_plot.TestPcolormesh.test_tx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/10193a9247d62a08b7ed61434ef5b189c7b40751.png" + ], + "iris.tests.test_plot.TestPcolormesh.test_ty.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c4413609a7701c0e0c4823d677bd3e39181bce16.png" + ], + "iris.tests.test_plot.TestPcolormesh.test_tz.0": [ + "https://scitools.github.io/test-images-scitools/image_files/747234677aa00f34cb49135043a03ff1361818d9.png" + ], + "iris.tests.test_plot.TestPcolormesh.test_yx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/e0dff0df961f5a7aa0e06cb81fc661acf5dc7474.png" + ], + "iris.tests.test_plot.TestPcolormesh.test_zx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/14c1392b7ccfd6966d2ba9281430b0f638d79a03.png" + ], + "iris.tests.test_plot.TestPcolormesh.test_zy.0": [ + "https://scitools.github.io/test-images-scitools/image_files/743934b3c5aa14de22ff775f296c8744af4fde05.png" + ], + "iris.tests.test_plot.TestPcolormeshNoBounds.test_tx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/edddddd5d22d623fb4d1a143a39db8057a4742f4.png" + ], + "iris.tests.test_plot.TestPcolormeshNoBounds.test_ty.0": [ + "https://scitools.github.io/test-images-scitools/image_files/a2ac84b94dd8b512fb5e77b8da157486fc30a232.png" + ], + "iris.tests.test_plot.TestPcolormeshNoBounds.test_tz.0": [ + "https://scitools.github.io/test-images-scitools/image_files/f6d1f29f4bf79198eae13145a64f7c936ed1d582.png" + ], + "iris.tests.test_plot.TestPcolormeshNoBounds.test_yx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c47aad379d3da85e70995a4775dd8c0f881d297b.png" + ], + "iris.tests.test_plot.TestPcolormeshNoBounds.test_zx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/d331b2a3543136ab5e5d51fe7cf7c2e067976cf9.png" + ], + "iris.tests.test_plot.TestPcolormeshNoBounds.test_zy.0": [ + "https://scitools.github.io/test-images-scitools/image_files/69afc985fc57279c12a5f97ddd7eca23b7aed7fc.png" + ], + "iris.tests.test_plot.TestPlot.test_t.0": [ + "https://scitools.github.io/test-images-scitools/image_files/ec760318aab220acf29d66f5a2007cf109f30194.png" + ], + "iris.tests.test_plot.TestPlot.test_t_dates.0": [ + "https://scitools.github.io/test-images-scitools/image_files/f84fe424e7c5ffdeeff15d1946f7d2ba65ef490e.png" + ], + "iris.tests.test_plot.TestPlot.test_x.0": [ + "https://scitools.github.io/test-images-scitools/image_files/ec89f5306f1b4a078f4547adddb9fc55eff15edf.png" + ], + "iris.tests.test_plot.TestPlot.test_y.0": [ + "https://scitools.github.io/test-images-scitools/image_files/1ac3bc18c016737efe66c0a356423eea3204b5e6.png" + ], + "iris.tests.test_plot.TestPlot.test_z.0": [ + "https://scitools.github.io/test-images-scitools/image_files/19cea174453fe151e0dfd39c11228fda6c9cfee4.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_non_cube_coordinate.0": [ + "https://scitools.github.io/test-images-scitools/image_files/c973d852e08896a67a368bf806c8de029038ff18.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_tx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/8f01262e3361ba06260b6b2821f4a09dc904efa2.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_tx.1": [ + "https://scitools.github.io/test-images-scitools/image_files/8e741d3f2b69f4cbee3e47bca9217938ac50eebc.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_tx.2": [ + "https://scitools.github.io/test-images-scitools/image_files/21957367ef36fbf347891c520c04558f94f62ca7.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_tx.3": [ + "https://scitools.github.io/test-images-scitools/image_files/bc73ecda38e30c90eebce3b951d6f1d898484af8.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_tx.4": [ + "https://scitools.github.io/test-images-scitools/image_files/39436a8c895057e3f29277858acfad6af89b7e36.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_tx.5": [ + "https://scitools.github.io/test-images-scitools/image_files/5bdd0865ba9c5664dc1743f139a6838fc676393a.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_x.0": [ + "https://scitools.github.io/test-images-scitools/image_files/3d792cfba0ca5d66ee22fac67d863aecd5606eda.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_y.0": [ + "https://scitools.github.io/test-images-scitools/image_files/202e1df3fae8e833d0949650c598efb0cd140e5a.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_yx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/6f87fe87f1ffb75f5e50cc8eaec4047b7584be93.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_yx.1": [ + "https://scitools.github.io/test-images-scitools/image_files/144c741aead354b149cb838df59b9db6c179f22b.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_yx.2": [ + "https://scitools.github.io/test-images-scitools/image_files/5a2784600f0dca647c817d6878bb2e0bd1f8e6f5.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_yx.3": [ + "https://scitools.github.io/test-images-scitools/image_files/37a79c901ac12b04e3303b785586fe2855ed24a2.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_yx.4": [ + "https://scitools.github.io/test-images-scitools/image_files/d34377839f882f665fede8e867a496e20a7499d4.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_yx.5": [ + "https://scitools.github.io/test-images-scitools/image_files/57d78a1764a6944006f732e647452850259e34a4.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_zx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/cff7fc43cc20f061cedfad66e15562c487b73b25.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_zx.1": [ + "https://scitools.github.io/test-images-scitools/image_files/18f4f6169d78bb0b9d4191a680d5c9fbb249dee3.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_zx.2": [ + "https://scitools.github.io/test-images-scitools/image_files/8f1799e8e9b5a9c7893d61b7b2f6c930396e9450.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_zx.3": [ + "https://scitools.github.io/test-images-scitools/image_files/0ec37a2ff0ba8b6df1122f5fac781c64f55a76fc.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_zx.4": [ + "https://scitools.github.io/test-images-scitools/image_files/6c2963b178809bf81c799d689aa507effe797419.png" + ], + "iris.tests.test_plot.TestPlotCoordinatesGiven.test_zx.5": [ + "https://scitools.github.io/test-images-scitools/image_files/59e7290980c342b05e2b2707e86e0768c3dd143e.png" + ], + "iris.tests.test_plot.TestPlotDimAndAuxCoordsKwarg.test_coord_names.0": [ + "https://scitools.github.io/test-images-scitools/image_files/92a0fb778fe3539faf14e9efca3b60fd6f8967fb.png" + ], + "iris.tests.test_plot.TestPlotDimAndAuxCoordsKwarg.test_coord_names.1": [ + "https://scitools.github.io/test-images-scitools/image_files/9295b9ff72e37335564eff01a2ec5e4bccf463dd.png" + ], + "iris.tests.test_plot.TestPlotDimAndAuxCoordsKwarg.test_coords.0": [ + "https://scitools.github.io/test-images-scitools/image_files/92a0fb778fe3539faf14e9efca3b60fd6f8967fb.png" + ], + "iris.tests.test_plot.TestPlotDimAndAuxCoordsKwarg.test_coords.1": [ + "https://scitools.github.io/test-images-scitools/image_files/9295b9ff72e37335564eff01a2ec5e4bccf463dd.png" + ], + "iris.tests.test_plot.TestPlotDimAndAuxCoordsKwarg.test_default.0": [ + "https://scitools.github.io/test-images-scitools/image_files/92a0fb778fe3539faf14e9efca3b60fd6f8967fb.png" + ], + "iris.tests.test_plot.TestPlotDimAndAuxCoordsKwarg.test_yx_order.0": [ + "https://scitools.github.io/test-images-scitools/image_files/a748361b255e33cf408dbb1005212bf21aee6a7b.png" + ], + "iris.tests.test_plot.TestPlotDimAndAuxCoordsKwarg.test_yx_order.1": [ + "https://scitools.github.io/test-images-scitools/image_files/84baaf4f046ec536e8f6f32494c03562575825ec.png" + ], + "iris.tests.test_plot.TestPlotOtherCoordSystems.test_plot_tmerc.0": [ + "https://scitools.github.io/test-images-scitools/image_files/fb5ac629208f3864e93d9e3df9137887f71e177d.png" + ], + "iris.tests.test_plot.TestQuickplotPlot.test_t.0": [ + "https://scitools.github.io/test-images-scitools/image_files/5c4d8a9c2dca9a57ecaf12afa85091a1587e125c.png" + ], + "iris.tests.test_plot.TestQuickplotPlot.test_t_dates.0": [ + "https://scitools.github.io/test-images-scitools/image_files/665a14c0697e3a0991e1c2ff303984fc4c206a76.png" + ], + "iris.tests.test_plot.TestQuickplotPlot.test_x.0": [ + "https://scitools.github.io/test-images-scitools/image_files/6fc00b020a645686cb332f80ab6fa7ab4902421e.png" + ], + "iris.tests.test_plot.TestQuickplotPlot.test_y.0": [ + "https://scitools.github.io/test-images-scitools/image_files/65fef514fff742d71ec88b2c414ef1f271019d5b.png" + ], + "iris.tests.test_plot.TestQuickplotPlot.test_z.0": [ + "https://scitools.github.io/test-images-scitools/image_files/4340a0484d945f089fa69c7613a1f0b6043fe112.png" + ], + "iris.tests.test_plot.TestSimple.test_bounds.0": [ + "https://scitools.github.io/test-images-scitools/image_files/248236308c46e42eb8f5c6f436808a1ba9727dfe.png" + ], + "iris.tests.test_plot.TestSimple.test_points.0": [ + "https://scitools.github.io/test-images-scitools/image_files/d28a67b006291c0f5386c2b50a5d63a5fe358cf1.png" + ], + "iris.tests.test_plot.TestSymbols.test_cloud_cover.0": [ + "https://scitools.github.io/test-images-scitools/image_files/9a54b4493a32f380aaaaeeee8eeda968b3ca2c53.png" + ], + "iris.tests.test_quickplot.TestLabels.test_alignment.0": [ + "https://scitools.github.io/test-images-scitools/image_files/099663b5c0dd1cf4c19a0c87c497cc9fb5bf011f.png" + ], + "iris.tests.test_quickplot.TestLabels.test_contour.0": [ + "https://scitools.github.io/test-images-scitools/image_files/bece9c7ca07a73c9bdf7b25fa2469fa61b04c37f.png" + ], + "iris.tests.test_quickplot.TestLabels.test_contour.1": [ + "https://scitools.github.io/test-images-scitools/image_files/a7b7ddf4d89b32d8f59011154190cba5dc1484f4.png" + ], + "iris.tests.test_quickplot.TestLabels.test_contourf.0": [ + "https://scitools.github.io/test-images-scitools/image_files/4af801dc3d081db570124bcaa269fcb5c364c724.png" + ], + "iris.tests.test_quickplot.TestLabels.test_contourf.1": [ + "https://scitools.github.io/test-images-scitools/image_files/a7b7ddf4d89b32d8f59011154190cba5dc1484f4.png" + ], + "iris.tests.test_quickplot.TestLabels.test_contourf.2": [ + "https://scitools.github.io/test-images-scitools/image_files/48298dbc091c279eb1674f1f1fb5b692b0fc32a2.png" + ], + "iris.tests.test_quickplot.TestLabels.test_contourf_nameless.0": [ + "https://scitools.github.io/test-images-scitools/image_files/81c7f4b0b2b506af20c55c6f762a4f6e812b25cd.png" + ], + "iris.tests.test_quickplot.TestLabels.test_map.0": [ + "https://scitools.github.io/test-images-scitools/image_files/71ba9935c4c4d7a5de8c94318b1b886ce9ee27cb.png" + ], + "iris.tests.test_quickplot.TestLabels.test_map.1": [ + "https://scitools.github.io/test-images-scitools/image_files/2531a058acebb2d395cdeac444e015a1ed977114.png" + ], + "iris.tests.test_quickplot.TestLabels.test_pcolor.0": [ + "https://scitools.github.io/test-images-scitools/image_files/81ccb3e1c9a205343e1666467a6a68560ab20c70.png" + ], + "iris.tests.test_quickplot.TestLabels.test_pcolormesh.0": [ + "https://scitools.github.io/test-images-scitools/image_files/23b255285e5b93ead96742c98d69942d49a3e4e8.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_non_cube_coordinate.0": [ + "https://scitools.github.io/test-images-scitools/image_files/3b501710b88eb0fee89e0bf6991cbe26a91dde40.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_tx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/24dcd675b066a4ceac4d74e4c4ec6d84d5b6584a.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_tx.1": [ + "https://scitools.github.io/test-images-scitools/image_files/d28a67b006291c0f5386c2b50a5d63a5fe358cf1.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_tx.2": [ + "https://scitools.github.io/test-images-scitools/image_files/5cc16996e640cc192d0d7c477499254b988726d2.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_tx.3": [ + "https://scitools.github.io/test-images-scitools/image_files/af90334cfac4da7da907d83b2a718b99c3ef13ed.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_tx.4": [ + "https://scitools.github.io/test-images-scitools/image_files/d6d5f20c52a1caad2dee6a808106cf188085f3d6.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_tx.5": [ + "https://scitools.github.io/test-images-scitools/image_files/62a58743b114392de24ef212674c21f71bb4f372.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_x.0": [ + "https://scitools.github.io/test-images-scitools/image_files/8ab60a9149fe130e8ee33dafce5a291f832465c1.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_y.0": [ + "https://scitools.github.io/test-images-scitools/image_files/8b803be114227b39cb4bf41fe8dd1355b31ca83b.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_yx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/58980b9a539d71094318403999772cdc7ef480b1.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_yx.1": [ + "https://scitools.github.io/test-images-scitools/image_files/0650e2de7082c3e2052758c584854023adce4c07.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_yx.2": [ + "https://scitools.github.io/test-images-scitools/image_files/a6c192b994f0781b3538a794bdddff0d84bd9954.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_yx.3": [ + "https://scitools.github.io/test-images-scitools/image_files/71ba9935c4c4d7a5de8c94318b1b886ce9ee27cb.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_yx.4": [ + "https://scitools.github.io/test-images-scitools/image_files/139739470587376aebae270abeca5100e2e996ff.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_yx.5": [ + "https://scitools.github.io/test-images-scitools/image_files/6e2ee19aab2fdcdf3e3cb940987abcd1d682fe48.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_zx.0": [ + "https://scitools.github.io/test-images-scitools/image_files/e8f27272cfb56af77be12f9652a63842a0fd9ce8.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_zx.1": [ + "https://scitools.github.io/test-images-scitools/image_files/3bced65ec9fdea60baeeea8a1743f9e7ab6f876f.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_zx.2": [ + "https://scitools.github.io/test-images-scitools/image_files/c83f0af560a06159f052d19b67166bf1636028e3.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_zx.3": [ + "https://scitools.github.io/test-images-scitools/image_files/995656ea051a42c5e2c0f27e71ab23fd929ca5a7.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_zx.4": [ + "https://scitools.github.io/test-images-scitools/image_files/da3401dbe9a72f6d5440e503077f3c5a8c822530.png" + ], + "iris.tests.test_quickplot.TestQuickplotCoordinatesGiven.test_zx.5": [ + "https://scitools.github.io/test-images-scitools/image_files/d2fe7bb8377160a3e7f6fff364d7b6e95cf03bc3.png" + ], + "iris.tests.test_quickplot.TestTimeReferenceUnitsLabels.test_not_reference_time_units.0": [ + "https://scitools.github.io/test-images-scitools/image_files/632a054a5fadd90e17de14d4052107801ce99f26.png" + ], + "iris.tests.test_quickplot.TestTimeReferenceUnitsLabels.test_reference_time_units.0": [ + "https://scitools.github.io/test-images-scitools/image_files/5da05ddeaaa666336d8daf1d1bc2473fda1b1fd0.png" + ] +} \ No newline at end of file diff --git a/lib/iris/tests/test_image_json.py b/lib/iris/tests/test_image_json.py new file mode 100644 index 0000000000..d363a81c7c --- /dev/null +++ b/lib/iris/tests/test_image_json.py @@ -0,0 +1,93 @@ +# (C) British Crown Copyright 2016, Met Office +# +# This file is part of Iris. +# +# Iris is free software: you can redistribute it and/or modify it under +# the terms of the GNU Lesser General Public License as published by the +# Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Iris is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Iris. If not, see . + + +from __future__ import (absolute_import, division, print_function) +from six.moves import (filter, input, map, range, zip) # noqa +import six + +# import iris tests first so that some things can be initialised before +# importing anything else +import iris.tests as tests + +import codecs +from collections import deque +import json +import logging +import os +from six.moves.queue import Queue +import requests +from threading import Thread + +# maximum number of threads for multi-threading code +MAXTHREADS = 128 + +# Turn down requests logging +logging.getLogger("requests").setLevel(logging.CRITICAL) + + +class _ResolveWorkerThread(Thread): + """ + A :class:threading.Thread which moves objects from an input queue to an + output deque using a 'dowork' method, as defined by a subclass. + """ + def __init__(self, aqueue, adeque, exceptions): + self.queue = aqueue + self.deque = adeque + self.exceptions = exceptions + Thread.__init__(self) + self.daemon = True + + def run(self): + while not self.queue.empty(): + resource = self.queue.get() + try: + result = requests.head(resource) + if (result.status_code == 200 and + resource.startswith('https://scitools.github.io')): + self.deque.append(resource) + else: + msg = '{} is not resolving correctly.'.format(resource) + self.exceptions.append(ValueError(msg)) + except Exception as e: + self.exceptions.append(e) + self.queue.task_done() + + +class TestImageFile(tests.IrisTest): + def test_resolve(self): + repo_fname = os.path.join(os.path.dirname(__file__), 'results', + 'imagerepo.json') + with open(repo_fname, 'rb') as fi: + repo = json.load(codecs.getreader('utf-8')(fi)) + uris = [] + for k, v in repo.iteritems(): + uris = uris + v + uri_list = deque() + exceptions = deque() + uri_queue = Queue() + for uri in uris: + uri_queue.put(uri) + + for i in range(MAXTHREADS): + _ResolveWorkerThread(uri_queue, uri_list, exceptions).start() + uri_queue.join() + self.assertEqual(deque(), exceptions) + + +if __name__ == "__main__": + tests.main()