-
Notifications
You must be signed in to change notification settings - Fork 15
Refactor axis sharing logic and improve test coverage for UltraPlot #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
_get_sharing_level
and add additional unittests for sharing
_get_sharing_level
and add additional unittests for sharingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors axis sharing logic in UltraPlot by replacing a centralized sharing level method with direct checks on sharing attributes, and adds comprehensive test coverage for axis sharing behavior across different modules.
- Removes the
_get_sharing_level()
method and replaces its usage with direct checks on_sharex
and_sharey
attributes - Adds parametrized tests for axis sharing levels in both regular and geographic plotting contexts
- Improves test coverage for renderer acquisition and label sharing methods
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
ultraplot/tests/test_sharing.py | New comprehensive test file covering x/y axis sharing levels with parametrized tests |
ultraplot/tests/test_geographic.py | Converts sharing level test to parametrized format and updates sharing logic reference |
ultraplot/tests/test_figure.py | Adds tests for renderer acquisition and label sharing methods |
ultraplot/figure.py | Removes _get_sharing_level() method and updates sharing checks to use direct attribute access |
ultraplot/axes/geo.py | Updates axis sharing logic to use direct sharing level checks and adds which parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Ok 19 tests left to fix, but some of them look good anyway. There are some things that needs fixing. Primarily, I need to look at the interface between geo and cartesian panels. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Closes #348
This PR refactors axis sharing logic and adds comprehensive tests to improve coverage and robustness across UltraPlot’s core plotting modules.
Key Changes
Core Logic
Refactored axis sharing checks in
GeoAxes
andFigure
:_get_sharing_level()
with direct checks on_sharex
and_sharey
for clarity and correctness.x
ory
), ensuring more precise control over label and tick sharing.which
argument to clarify axis context.Removed unused method:
_get_sharing_level()
fromFigure
.Tests
Added new tests in
test_figure.py
:_get_renderer
to ensure renderer acquisition works as expected._share_labels_with_others
, including both early return (no sharing) and execution with sharing enabled.Added new tests in
test_sharing.py
:Improved tests in
test_geographic.py
:Why?
_sharex
and_sharey
makes the code easier to understand and less error-prone.