Skip to content

Conversation

cvanelteren
Copy link
Collaborator

The previous implementation had complex and distributed logic for determining tick and label visibility, which was difficult to maintain and extend. This refactoring centralizes the logic within the Figure class, making it more robust and easier to understand.

Key changes:

  • A new _share_ticklabels method in Figure now handles all tick label sharing.
  • The _get_border_axes method has been improved to be more accurate.
  • The _Crawler utility in ultraplot/utils.py has been rewritten to better handle complex layouts with panels and mixed axes types.
  • Redundant and complex logic has been removed from CartesianAxes, GeoAxes, and other modules.'

This commit introduces a major refactoring of the tick and label sharing mechanism in UltraPlot.

The previous implementation had complex and distributed logic for determining tick and label visibility, which was difficult to maintain and extend. This refactoring centralizes the logic within the `Figure` class, making it more robust and easier to understand.

Key changes:
- A new `_share_ticklabels` method in `Figure` now handles all tick label sharing.
- The `_get_border_axes` method has been improved to be more accurate.
- The `_Crawler` utility in `ultraplot/utils.py` has been rewritten to better handle complex layouts with panels and mixed axes types.
- Redundant and complex logic has been removed from `CartesianAxes`, `GeoAxes`, and other modules.
This commit updates the test suite to align with the new tick and label sharing mechanism.

Key changes:
- Added `fig.canvas.draw()` calls in numerous tests to ensure that the new, deferred label sharing logic is triggered before assertions.
- Updated assertions in tests for `CartesianAxes`, `GeoAxes`, and subplots to match the expected behavior of the refactored implementation.
- Added new tests to cover more complex scenarios with panels and mixed axes types.
Copy link

codecov bot commented Oct 18, 2025

Codecov Report

❌ Patch coverage is 92.28856% with 31 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/figure.py 88.02% 14 Missing and 9 partials ⚠️
ultraplot/gridspec.py 40.00% 2 Missing and 1 partial ⚠️
ultraplot/utils.py 92.85% 2 Missing and 1 partial ⚠️
ultraplot/axes/polar.py 85.71% 1 Missing ⚠️
ultraplot/tests/test_subplots.py 98.71% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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