diff --git a/ci/asv.yml b/ci/asv.yml index 7062c7e33..b3ad61f1d 100644 --- a/ci/asv.yml +++ b/ci/asv.yml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - python=3.11 - - cartopy + - cartopy<0.26 # cartopy 0.26.0 breaks some geoviews plots; see issue #1780. - dask - datashader - geoviews diff --git a/ci/docs.yml b/ci/docs.yml index 07172c0d2..8eddd92dd 100644 --- a/ci/docs.yml +++ b/ci/docs.yml @@ -34,7 +34,7 @@ dependencies: - hvplot - holoviews - geoviews - - cartopy + - cartopy<0.26 # cartopy 0.26.0 breaks some geoviews plots; see issue #1780. - pandas - geocat-datafiles - spatialpandas diff --git a/ci/environment.yml b/ci/environment.yml index 938470f61..cce05047e 100644 --- a/ci/environment.yml +++ b/ci/environment.yml @@ -4,7 +4,7 @@ channels: - nodefaults dependencies: - antimeridian - - cartopy + - cartopy<0.26 # cartopy 0.26.0 breaks some geoviews plots; see issue #1780. - dask - datashader - geoviews diff --git a/pyproject.toml b/pyproject.toml index 510d81717..fc15f2fb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,10 +54,11 @@ geo = [ "spatialpandas", ] viz = [ - "cartopy", + "cartopy<0.26", # cartopy 0.26.0 breaks some geoviews plots; see issue #1780. + # (cartopy pin intentionally here but not in "geo" extras because geoviews is only in "viz".) "datashader", "matplotlib<3.11", # matplotlib 3.11.0 breaks some plots but <3.11 is fine; see issue #1542. - "geoviews", + "geoviews", # no version pin; newer should support any cartopy; see holoviz/geoviews#884. "holoviews", "hvplot", ] diff --git a/test/test_plot.py b/test/test_plot.py index 26836f8ee..bdaca1fd8 100644 --- a/test/test_plot.py +++ b/test/test_plot.py @@ -361,9 +361,18 @@ def __init__(self, params): def test_plot_topology_with_explicit_projection(gridpath): """`plot.edges` with an explicit projection exercises the central-longitude - lookup that regressed under cartopy 0.26.""" - import cartopy.crs as ccrs - + lookup that regressed under cartopy 0.26. + Regression test for issue #1780. + """ uxgrid = ux.open_grid(gridpath("mpas", "QU", "oQU480.231010.nc")) - uxgrid.plot.edges(backend="matplotlib", projection=ccrs.PlateCarree()) - uxgrid.plot.edges(backend="matplotlib", projection=ccrs.Robinson()) + plot0 = uxgrid.plot.edges(backend="matplotlib", projection=ccrs.PlateCarree()) + plot1 = uxgrid.plot.edges(backend="matplotlib", projection=ccrs.Robinson()) + plot2 = uxgrid.plot.edges(backend="matplotlib", projection=ccrs.Orthographic()) + + # the crash associated with issue #1780 only occurs when actually trying to render, + # and only for some projections, but definitely for at least one of the above, + # so, try to render all three of them. + renderer = hv.renderer("matplotlib") + renderer.get_plot(plot0) + renderer.get_plot(plot1) + renderer.get_plot(plot2)