Skip to content

Fix/gridspec indexing#667

Merged
cvanelteren merged 2 commits intomainfrom
fix/gridspec-indexing
Mar 30, 2026
Merged

Fix/gridspec indexing#667
cvanelteren merged 2 commits intomainfrom
fix/gridspec-indexing

Conversation

@cvanelteren
Copy link
Copy Markdown
Collaborator

@cvanelteren cvanelteren commented Mar 30, 2026

Follow up to #666
The first was the intended indexing change. SubplotGrid.getitem used to unwrap a single-item 2D slice and return the axis itself. After the fix, a slice always returns a SubplotGrid, even when it contains one axis. That changed object identity in a few tests, so the gridspec, legend, and subplots expectations had to be updated. That part was the regression you originally pointed out, and it is now already on main.

The second issue was not caused by indexing. When I widened the test run, a geo-sharing failure showed up because cartopy cyl was being misclassified as non-rectilinear in ultraplot/axes/geo.py. In this environment, cartopy reports several projections with name == "unknown", so the old string-based check missed PlateCarree/cyl. That made the shared ticklabel logic treat a rectilinear geo axis like a curved one and skip sharing behavior. The fix was to classify known rectilinear cartopy projections by class instead of relying on proj.name, and then update the projection-sharing tests in ultraplot/tests/test_projections.py.

While validating the rebased branch, I also found a separate baseline failure in the inset colorbar helper test. That one came from invalid non-finite artist extents being included in the reflow check in ultraplot/axes/base.py, plus a brittle pre-reflow assertion in ultraplot/tests/test_axes_base_colorbar_helpers.py. I fixed both because you wanted the full suite green.

…relax the helper regression to assert the stable post-reflow behavior, and document that broad pytest verification should run with -n 4 so future validation stays fast on top of main.
@cvanelteren cvanelteren enabled auto-merge (squash) March 30, 2026 22:12
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 86.27451% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/axes/base.py 76.00% 3 Missing and 3 partials ⚠️
ultraplot/axes/geo.py 83.33% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@cvanelteren cvanelteren merged commit f229363 into main Mar 30, 2026
19 checks passed
@cvanelteren cvanelteren deleted the fix/gridspec-indexing branch March 30, 2026 22:21
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