-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
3.2.0 may break some Cartopy tests #15806
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
Comments
|
I just realized the conda-forge packages of Cartopy do not include the test images, so you will need to grab them from GitHub or install via source if you want to test |
@QuLogic, Happy to look at this, but I'm not 100% clear if the problem is just that an image test broke, which is expected if it used auto limits, or if the image looks really bad. |
Well, the problem is that the test limits are now 0 (or maybe whatever In Cartopy, artists can have an arbitrary transform that is unrelated to the transform of the Axes (which is fundamental to how it works since data and map may come from different coordinate systems.) For Please excuse any errors I may have made; I have no internet and am trying to answer the specifics from memory. |
@QuLogic Looks like you may need the following as well, due to #13581: diff --git a/lib/cartopy/tests/mpl/__init__.py b/lib/cartopy/tests/mpl/__init__.py
index 6ba66cc..bc9fe42 100644
--- a/lib/cartopy/tests/mpl/__init__.py
+++ b/lib/cartopy/tests/mpl/__init__.py
@@ -31,7 +31,6 @@ import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.testing import setup as mpl_setup
import matplotlib.testing.compare as mcompare
-import matplotlib._pylab_helpers as pyplot_helpers
MPL_VERSION = distutils.version.LooseVersion(mpl.__version__)
@@ -211,12 +210,12 @@ class ImageTesting(object):
plt.switch_backend('agg')
mpl_setup()
- if pyplot_helpers.Gcf.figs:
+ if plt.get_fignums():
warnings.warn('Figures existed before running the %s %s test.'
' All figures should be closed after they run. '
'They will be closed automatically now.' %
(mod_name, test_name))
- pyplot_helpers.Gcf.destroy_all()
+ plt.close('all')
if MPL_VERSION >= '2':
style_context = mpl.style.context
@@ -228,14 +227,12 @@ class ImageTesting(object):
with style_context(self.style):
r = test_func(*args, **kwargs)
- fig_managers = pyplot_helpers.Gcf._activeQue
- figures = [manager.canvas.figure for manager in fig_managers]
-
+ figures = [plt.figure(num) for num in plt.get_fignums()]
try:
self.run_figure_comparisons(figures, test_name=mod_name)
finally:
for figure in figures:
- pyplot_helpers.Gcf.destroy_fig(figure)
+ plt.close(figure)
plt.switch_backend(orig_backend)
return r |
Isn't that in 3.3.0, only? I'll look into that some time. |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
I've started trying to get Cartopy working with the latest Matplotlib releases. Currently a lot of things fail, but there are some new things in 3.2.0rc1 that we may want to fix before releasing. Unfortunately, all those existing failures make it difficult to determine what's new, but I believe the following are introduced by 3.2.0rc1.
Code for reproduction
Actual outcome
For
test_limits_contour
:For
test_contour_plot_bounds
:For
test_global_contourf_wrap_no_transform
:The test image is cropped into a very small area.
For
test_pcolormesh_goode_wrap
, andtest_pcolormesh_mercator_wrap
:The left edge of the image is visibly cropped.
Expected outcome
Tests pass.
Matplotlib version
print(matplotlib.get_backend())
): AggThe text was updated successfully, but these errors were encountered: