FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Feature add] Share Axes in GeoPlot + bug fixes by cvanelteren · Pull Request #159 · Ultraplot/UltraPlot · GitHub

Repository navigation

[Feature add] Share Axes in GeoPlot + bug fixes - #159

Merged
cvanelteren merged 156 commits into
Ultraplot:mainfrom
cvanelteren:feat-shared-geo-new
May 11, 2025
Merged

cvanelteren merged 156 commits into
Ultraplot:mainfrom
cvanelteren:feat-shared-geo-new

Conversation

Copy link
Copy Markdown
Collaborator

Addresses #155 and #158

Copy link
Copy Markdown
Collaborator Author

Note: Tests will fail on added tests.

cvanelteren changed the title Feat shared geo new [Feature addd] Share Axes in GeoPlot + bug fixes Apr 14, 2025

codecov Bot commented Apr 15, 2025 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.36153% with 34 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/axes/geo.py 90.03% 13 Missing and 15 partials ⚠️
ultraplot/figure.py 95.08% 1 Missing and 2 partials ⚠️
ultraplot/tests/test_geographic.py 99.02% 0 Missing and 2 partials ⚠️
ultraplot/axes/base.py 94.73% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

cvanelteren marked this pull request as draft April 16, 2025 10:52
cvanelteren changed the title [Feature addd] Share Axes in GeoPlot + bug fixes [Feature add] Share Axes in GeoPlot + bug fixes Apr 16, 2025
cvanelteren requested review from beckermr and Copilot April 16, 2025 19:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull Request Overview

This PR adds a feature to share axes on geographic plots and includes bug fixes related to axis sharing and test configuration.

  • Adds tests for validating shared geographic tick configurations.
  • Refactors axis sharing logic in GeoAxes and related modules.
  • Removes extraneous debug prints in test configuration.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ultraplot/tests/test_geographic.py Adds new tests for geographic ticks and shared axis behavior
ultraplot/tests/conftest.py Removes debug print statements from test failure handling
ultraplot/figure.py Updates subplot creation and axis sharing logic for GeoAxes
ultraplot/axes/shared.py Adjusts share function signatures and minor ticker handling
ultraplot/axes/geo.py Extensive refactor for GeoAxes: sharing, toggling ticks and gridliner labels
ultraplot/axes/base.py Adds an _unshare method and a guard for NaN padding values
Comments suppressed due to low confidence (1)

ultraplot/axes/geo.py:1780

  • [nitpick] Consider renaming the loop variable 'object' to something like 'obj' to avoid shadowing the built-in 'object'.
for object in objects:

Comment thread ultraplot/axes/base.py Outdated

Copy link
Copy Markdown
Collaborator Author

Will add more tests tomorrow for codecov but it's looking good locally with a few plots showing different sizes but otherwise have high visual fidelity. Opening this up for review.

cvanelteren marked this pull request as ready for review May 10, 2025 07:54
cvanelteren requested a review from beckermr May 10, 2025 07:54

beckermr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I took a closer look at the image test failure:

Here is the code:

@pytest.mark.mpl_image_compare
def test_geoticks():

    lonlim = (-140, 60)
    latlim = (-10, 50)
    basemap_projection = uplt.Proj(
        "cyl",
        lonlim=lonlim,
        latlim=latlim,
        backend="basemap",
    )
    fig, ax = uplt.subplots(
        ncols=3,
        proj=(
            "cyl",  # cartopy
            "cyl",  # cartopy
            basemap_projection,  # basemap
        ),
        share=0,
    )
    settings = dict(land=True, labels=True, lonlines=20, latlines=20)
    # Shows sensible "default"; uses cartopy backend to show the grid lines with ticks
    ax[0].format(
        lonlim=lonlim,
        latlim=latlim,
        **settings,
    )

    # Add lateral ticks only
    ax[1].format(
        latticklen=True,
        gridminor=True,
        lonlim=lonlim,
        latlim=latlim,
        **settings,
    )

    ax[2].format(
        latticklen=5.0,
        lonticklen=2.0,
        grid=False,
        gridminor=False,
        **settings,
    )
    return fig

Here is a zoom of the middle panel (top is baseline, bottom is this PR):

It appears that the call to set latlim for the middle panel is now being ignored in the new version of the code in this PR. This is definitely a bug. I don't see why latlim should now be ignored.

Copy link
Copy Markdown
Collaborator Author

Fixed @beckermr :

Copy link
Copy Markdown
Collaborator Author

Not sure why the ticks are not using the full range but I cut off the edges here and it looks the same.

cvanelteren requested a review from beckermr May 10, 2025 14:50

Copy link
Copy Markdown
Collaborator Author

weirdly enough when I do this for the basemap the yticks behave strangely. Only one appears.

Comment thread ultraplot/axes/geo.py Outdated

beckermr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Two more items. Thank you so much for the good work on this PR!

Comment thread ultraplot/tests/test_figure.py Outdated
Comment thread ultraplot/tests/test_geographic.py Outdated

beckermr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM! Great work on this PR!

Copy link
Copy Markdown
Collaborator Author

Will draft an appropriate release to 1.5. Lots of new features 😄

cvanelteren enabled auto-merge (squash) May 11, 2025 10:15
cvanelteren disabled auto-merge May 11, 2025 10:16
cvanelteren merged commit e6b1bc6 into Ultraplot:main May 11, 2025
cvanelteren added a commit that referenced this pull request Aug 14, 2025
- Added ability to share GeoAxes
- Fixed numerous bugs regarding ticks on GeoAxes
- Backend allows for sharing and unsharing axes.

---------

Co-authored-by: Matthew R. Becker <beckermr@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cvanelteren added a commit that referenced this pull request Jan 16, 2026
- Added ability to share GeoAxes
- Fixed numerous bugs regarding ticks on GeoAxes
- Backend allows for sharing and unsharing axes.

---------

Co-authored-by: Matthew R. Becker <beckermr@users.noreply.github.com>
Co-authored-by: Copilot <175728472+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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL