rm snooze graph#1829
Open
gauteh wants to merge 4 commits into
Open
Conversation
gauteh
commented
Jun 23, 2026
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
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>
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.