Skip to content

Commit a193229

Browse files
bjlittlepp-mo
authored andcommitted
unpin mpl (SciTools#3468)
1 parent b1f9b84 commit a193229

File tree

8 files changed

+74
-86
lines changed

8 files changed

+74
-86
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ script:
127127
- >
128128
if [[ ${TEST_TARGET} == 'default' ]]; then
129129
export IRIS_REPO_DIR=${INSTALL_DIR};
130-
python -m iris.tests.runner --default-tests --system-tests --print-failed-images;
130+
python -m iris.tests.runner --default-tests --system-tests;
131131
fi
132132
133133
- if [[ ${TEST_TARGET} == 'example' ]]; then
134-
python -m iris.tests.runner --example-tests --print-failed-images;
134+
python -m iris.tests.runner --example-tests;
135135
fi
136136

137137
# A call to check "whatsnew" contributions are valid, because the Iris test

docs/iris/example_code/Meteorology/COP_maps.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ def main():
103103

104104
# Add the first subplot showing the E1 scenario
105105
plt.subplot(121)
106-
plt.title('HadGEM2 E1 Scenario', fontsize=10)
106+
plt.title('HadGEM2 E1 Scenario', fontsize=10)
107107
iplt.contourf(delta_e1, levels, colors=colors, extend='both')
108108
plt.gca().coastlines()
109109
# get the current axes' subplot for use later on
110110
plt1_ax = plt.gca()
111111

112112
# Add the second subplot showing the A1B scenario
113113
plt.subplot(122)
114-
plt.title('HadGEM2 A1B-Image Scenario', fontsize=10)
114+
plt.title('HadGEM2 A1B-Image Scenario', fontsize=10)
115115
contour_result = iplt.contourf(delta_a1b, levels, colors=colors,
116116
extend='both')
117117
plt.gca().coastlines()
@@ -131,8 +131,7 @@ def main():
131131
width = left - first_plot_left + width
132132

133133
# Add axes to the figure, to place the colour bar
134-
colorbar_axes = fig.add_axes([first_plot_left, bottom + 0.07,
135-
width, 0.03])
134+
colorbar_axes = fig.add_axes([first_plot_left, 0.18, width, 0.03])
136135

137136
# Add the colour bar
138137
cbar = plt.colorbar(contour_result, colorbar_axes,

docs/iris/src/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) British Crown Copyright 2010 - 2018, Met Office
1+
# (C) British Crown Copyright 2010 - 2019, Met Office
22
#
33
# This file is part of Iris.
44
#
@@ -64,7 +64,6 @@
6464
'sphinx.ext.imgmath',
6565
'sphinx.ext.intersphinx',
6666
'matplotlib.sphinxext.mathmpl',
67-
'matplotlib.sphinxext.only_directives',
6867
'matplotlib.sphinxext.plot_directive',
6968

7069
# better class documentation

docs/iris/src/userguide/cube_maths.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ Finally, the cube we have created needs to be given a suitable name::
205205
The result could now be plotted using the guidance provided in the
206206
:doc:`plotting_a_cube` section.
207207

208-
.. htmlonly::
208+
.. only:: html
209209

210210
A very similar example to this can be found in
211211
:doc:`/examples/Meteorology/deriving_phenomena`.
212212

213-
.. latexonly::
213+
.. only:: latex
214214

215215
A very similar example to this can be found in the examples section,
216216
with the title "Deriving Exner Pressure and Air Temperature".

docs/iris/src/userguide/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fully before experimenting with your own data files.
1313
Much of the content has supplementary links to the reference documentation; you will not need to follow these
1414
links in order to understand the guide but they may serve as a useful reference for future exploration.
1515

16-
.. htmlonly::
16+
.. only:: html
1717

1818
Since later pages depend on earlier ones, try reading this user guide sequentially using the ``next`` and ``previous`` links.
1919

lib/iris/tests/results/imagerepo.json

Lines changed: 62 additions & 31 deletions
Large diffs are not rendered by default.

lib/iris/tests/runner/_runner.py

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) British Crown Copyright 2010 - 2017, Met Office
1+
# (C) British Crown Copyright 2010 - 2019, Met Office
22
#
33
# This file is part of Iris.
44
#
@@ -29,41 +29,6 @@
2929
import sys
3030

3131

32-
def failed_images_html():
33-
"""
34-
Generates HTML which shows the image failures side-by-side
35-
when viewed in a web browser.
36-
"""
37-
from iris.tests.idiff import step_over_diffs
38-
39-
data_uri_template = '<img alt="{alt}" src="data:image/png;base64,{img}">'
40-
41-
def image_as_base64(fname):
42-
with open(fname, "rb") as fh:
43-
return fh.read().encode("base64").replace("\n", "")
44-
45-
html = ['<!DOCTYPE html>', '<html>', '<body>']
46-
rdir = os.path.join(os.path.dirname(__file__), os.path.pardir,
47-
'result_image_comparison')
48-
if not os.access(rdir, os.W_OK):
49-
rdir = os.path.join(os.getcwd(), 'iris_image_test_output')
50-
51-
for expected, actual, diff in step_over_diffs(rdir, 'similar', False):
52-
expected_html = data_uri_template.format(
53-
alt='expected', img=image_as_base64(expected))
54-
actual_html = data_uri_template.format(
55-
alt='actual', img=image_as_base64(actual))
56-
diff_html = data_uri_template.format(
57-
alt='diff', img=image_as_base64(diff))
58-
59-
html.extend([expected, '<br>',
60-
expected_html, actual_html, diff_html,
61-
'<br><hr>'])
62-
63-
html.extend(['</body>', '</html>'])
64-
return '\n'.join(html)
65-
66-
6732
# NOTE: Do not inherit from object as distutils does not like it.
6833
class TestRunner():
6934
"""Run the Iris tests under nose and multiprocessor for performance"""
@@ -84,12 +49,9 @@ class TestRunner():
8449
('num-processors=', 'p', 'The number of processors used for running '
8550
'the tests.'),
8651
('create-missing', 'm', 'Create missing test result files.'),
87-
('print-failed-images', 'f', 'Print HTML encoded version of failed '
88-
'images.'),
8952
]
9053
boolean_options = ['no-data', 'system-tests', 'stop', 'example-tests',
91-
'default-tests', 'coding-tests', 'create-missing',
92-
'print-failed-images']
54+
'default-tests', 'coding-tests', 'create-missing']
9355

9456
def initialize_options(self):
9557
self.no_data = False
@@ -100,7 +62,6 @@ def initialize_options(self):
10062
self.coding_tests = False
10163
self.num_processors = None
10264
self.create_missing = False
103-
self.print_failed_images = False
10465

10566
def finalize_options(self):
10667
# These enviroment variables will be propagated to all the
@@ -185,6 +146,4 @@ def run(self):
185146
# word Mixin.
186147
result &= nose.run(argv=args)
187148
if result is False:
188-
if self.print_failed_images:
189-
print(failed_images_html())
190149
exit(1)

requirements/core.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cartopy
88
cf-units>=2
99
cftime
1010
dask[array]>=1.2.0 #conda: dask>=1.2.0
11-
matplotlib>=2,<3
11+
matplotlib
1212
netcdf4
1313
numpy>=1.14
1414
scipy

0 commit comments

Comments
 (0)