From 14060b91caca9e7a1af1394d90b9925e2378ae32 Mon Sep 17 00:00:00 2001 From: Sam Evans <47793072+Sevans711@users.noreply.github.com> Date: Wed, 23 Sep 2026 08:10:54 -0400 Subject: [PATCH 1/3] pin cartopy<0.26; fix relevant regression test --- ci/asv.yml | 2 +- ci/docs.yml | 2 +- ci/environment.yml | 2 +- pyproject.toml | 4 ++-- test/test_plot.py | 19 ++++++++++++++----- 5 files changed, 19 insertions(+), 10 deletions(-) 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..af96fd886 100644 --- a/ci/environment.yml +++ b/ci/environment.yml @@ -4,7 +4,7 @@ channels: - nodefaults dependencies: - antimeridian - - cartopy + - cartopy # cartopy 0.26.0 breaks some geoviews plots; see issue #1780. - dask - datashader - geoviews diff --git a/pyproject.toml b/pyproject.toml index 510d81717..c894a440f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,10 +54,10 @@ geo = [ "spatialpandas", ] viz = [ - "cartopy", + "cartopy<0.26", # cartopy 0.26.0 breaks some geoviews plots; see issue #1780. "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) From 17bbf01e470b9d38f91826191eb775a932e39668 Mon Sep 17 00:00:00 2001 From: Sam Evans <47793072+Sevans711@users.noreply.github.com> Date: Wed, 23 Sep 2026 08:38:13 -0400 Subject: [PATCH 2/3] fix typo (forgot cartopy pin in one spot) --- ci/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/environment.yml b/ci/environment.yml index af96fd886..cce05047e 100644 --- a/ci/environment.yml +++ b/ci/environment.yml @@ -4,7 +4,7 @@ channels: - nodefaults dependencies: - antimeridian - - cartopy # cartopy 0.26.0 breaks some geoviews plots; see issue #1780. + - cartopy<0.26 # cartopy 0.26.0 breaks some geoviews plots; see issue #1780. - dask - datashader - geoviews From f42df5ae169e24b450cc6a5408077f0729744205 Mon Sep 17 00:00:00 2001 From: Sam Evans <47793072+Sevans711@users.noreply.github.com> Date: Wed, 23 Sep 2026 14:08:11 -0400 Subject: [PATCH 3/3] comment to say why no cartopy pin in geo extras --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index c894a440f..fc15f2fb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,7 @@ geo = [ ] viz = [ "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", # no version pin; newer should support any cartopy; see holoviz/geoviews#884.