-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unpin matplotlib to support >=2.0 #3019
Changes from all commits
d374f01
8c2e6fb
e4e17f1
330f78e
ff88152
83845e8
4edea6b
94fa447
4d6be6f
bf962fc
0b82e80
0c7c5cc
9908326
220c1db
5373ace
15a90d0
9189e3a
9c6da6b
547021b
c11ff00
6fa9aba
ec41286
8a91ce9
909e5bf
374c269
d0eb638
2ba0e5e
f4b7d49
dd99372
9d74f27
5d13998
33f807f
a71459e
a570742
157ec03
e51b862
cf8183b
42d20d8
d3f792a
e78405f
b29c552
f1a515e
a921c45
578dcbc
f08bfbc
c2f58db
b2e2973
6936644
36e31ba
3080045
bb0917a
36f3e31
1519bfb
c82d2fa
ea9c419
4060a31
b06a7f4
143c509
f6e98ee
838afd2
7b16d44
764287a
46b974a
27aa953
f524eeb
f555333
082ba81
060190a
c055f1e
adb51be
66415da
cc9576d
ded76dc
23e1ef0
2e08272
5c618eb
84cf9b4
4916a82
35cf973
3aaed92
ebe8cc8
fc05b90
83d506b
b49b289
6bf5d9f
fbfe0e1
c19188e
f4cb02e
f88a90e
e7cd270
7d87cd0
fdeeeb7
eaeda68
1d9999f
65087d8
bb733c1
a468646
1e43862
d97dfd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -390,7 +390,7 @@ def _weighted_mean_with_mdtol(data, weights, axis=None, mdtol=0): | ||
weights_sum = weights.sum(axis=axis) | weights_sum = weights.sum(axis=axis) | ||
frac_masked = 1 - np.true_divide(unmasked_weights_sum, weights_sum) | frac_masked = 1 - np.true_divide(unmasked_weights_sum, weights_sum) | ||
mask_pt = frac_masked > mdtol | mask_pt = frac_masked > mdtol | ||
if np.any(mask_pt): | if np.any(mask_pt) and not isinstance(res, ma.core.MaskedConstant): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A slight behaviour change between Our test was abusing this convenience prior to >>> import numpy as np
>>> np.__version__
'1.14.3'
>>> import numpy.ma as ma
>>> a = ma.array([1.0], mask=True)
>>> m = a[0]
>>> type(m)
<class 'numpy.ma.core.MaskedConstant'>
>>> m.mask |= True
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: output array is read-only as opposed to >>> import numpy as np
>>> np.__version__
'1.13.3'
>>> import numpy.ma as ma
>>> a = ma.array([1.0], mask=True)
>>> m = a[0]
>>> type(m)
<class 'numpy.ma.core.MaskedConstant'>
>>> m.mask |= True
>>> m
masked
>>> m.mask |= False
>>> m
masked |
|||
if np.isscalar(res): | if np.isscalar(res): | ||
res = ma.masked | res = ma.masked | ||
elif ma.isMaskedArray(res): | elif ma.isMaskedArray(res): | ||
|
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -78,6 +78,9 @@ | ||
import matplotlib | import matplotlib | ||
matplotlib.use('agg') | matplotlib.use('agg') | ||
matplotlib.rcdefaults() | matplotlib.rcdefaults() | ||
# Standardise the figure size across matplotlib versions. | |||
# This permits matplotlib png image comparison. | |||
matplotlib.rcParams['figure.figsize'] = [8.0, 6.0] | |||
import matplotlib.testing.compare as mcompare | import matplotlib.testing.compare as mcompare | ||
import matplotlib.pyplot as plt | import matplotlib.pyplot as plt | ||
except ImportError: | except ImportError: | ||
|
@@ -835,7 +838,7 @@ def _create_missing(): | ||
'for test {}.') | 'for test {}.') | ||
msg = msg.format(phash, distances, unique_id) | msg = msg.format(phash, distances, unique_id) | ||
if _DISPLAY_FIGURES: | if _DISPLAY_FIGURES: | ||
emsg = 'Image comparion would have failed: {}' | emsg = 'Image comparison would have failed: {}' | ||
print(emsg.format(msg)) | print(emsg.format(msg)) | ||
else: | else: | ||
emsg = 'Image comparison failed: {}' | emsg = 'Image comparison failed: {}' | ||
|
@@ -1174,7 +1177,7 @@ class MyPlotTests(test.GraphicsTest): | ||
|
|
||
|
|
||
skip_sample_data = unittest.skipIf(not SAMPLE_DATA_AVAILABLE, | skip_sample_data = unittest.skipIf(not SAMPLE_DATA_AVAILABLE, | ||
('Test(s) require "iris_sample_data", ' | ('Test(s) require "iris-sample-data", ' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤣 |
|||
'which is not available.')) | 'which is not available.')) | ||
|
|
||
|
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be interested to see that this is the right thing to do. Will dig a little.