Skip to content

rm snooze graph#1829

Open
gauteh wants to merge 4 commits into
OpenDrift:masterfrom
gauteh:rm-snooze-graph
Open

rm snooze graph#1829
gauteh wants to merge 4 commits into
OpenDrift:masterfrom
gauteh:rm-snooze-graph

Conversation

@gauteh

@gauteh gauteh commented Jun 23, 2026

Copy link
Copy Markdown
Member
  • plot: protect gridliner against Shapely 2.x LinearRing error
  • fix: wrap gridliner.get_tightbbox to handle None bboxes from cartopy
  • tests: remove snooze of plotting tests

gauteh and others added 2 commits June 19, 2026 12:20
Cartopy's _draw_gridliner builds a sgeom.Polygon from the map boundary
path vertices.  In Shapely 2.x the underlying LinearRing constructor
requires the ring to be closed (first == last vertex), but older Cartopy
builds do not ensure this, causing:

  GEOSException: Points of LinearRing do not form a closed linestring

Wrap _draw_gridliner on each created gridliner instance so that this
rendering error is silently swallowed rather than aborting figure saving.
When _draw_gridliner silently fails (Shapely 2.x / older Cartopy),
label artists are left with no bounding box. Cartopy's get_tightbbox
then calls Bbox.union([None, None]) which raises AttributeError.
Wrapping get_tightbbox to return None (valid: means 'no visible bbox')
prevents the crash during matplotlib tight-layout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gauteh gauteh requested a review from knutfrode as a code owner June 23, 2026 12:07
gauteh and others added 2 commits June 23, 2026 15:25
…abels

Setting gl.top_labels = None after calling ax.gridlines(draw_labels=True)
is invalid in newer Cartopy (only bool/list/str are accepted) and caused
blank plots. Use the Cartopy draw_labels list API introduced in Cartopy
0.20 to request labels only on left and bottom sides directly, removing
the need for post-hoc patching and the workarounds for Bbox.union errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gauteh gauteh force-pushed the rm-snooze-graph branch from 079a2b6 to 94955d6 Compare June 23, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant