Skip to content

Fix DMS not set on some projections #293

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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

cvanelteren
Copy link
Contributor

@cvanelteren cvanelteren commented Jun 28, 2025

Addresses #292 where DMS is not set for some axes that should have it set.

@cvanelteren
Copy link
Contributor Author

Some baselines will probable fail (but maybe not). Will add a test.

Copy link

codecov bot commented Jun 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@Copilot Copilot AI left a 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 ensures degree-minute-second (DMS) formatting is consistently applied to projections that require it.

  • Added a test to verify DMS formatting on the Mercator projection.
  • Removed explicit gridline formatter overrides so axis formatters can propagate DMS formatting.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ultraplot/tests/test_geographic.py Add test_dms_used_for_mercator to validate DMS formatting
ultraplot/axes/geo.py Remove explicit gl.xformatter/gl.yformatter assignments
Comments suppressed due to low confidence (2)

ultraplot/tests/test_geographic.py:864

  • The new test only verifies longitude formatting (xformatter). To fully cover DMS behavior, add assertions for latitude formatting using gridlines_major.yformatter on the lat ticks.
        a = ax[0].gridlines_major.xformatter(tick)

ultraplot/axes/geo.py:1708

  • By removing the explicit assignment of gl.xformatter and gl.yformatter, gridlines may no longer pick up the DMS formatter from the axis. Consider reintroducing these assignments (after the axis formatter is configured) so gridlines use the correct DMS formatter.
        )

Copy link
Collaborator

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

This change confuses me. There were no cases where the code that's been removed was needed?

@cvanelteren
Copy link
Contributor Author

Actually you are right, I thought I added this but that's not true will do some more searching why it is not working.

@cvanelteren
Copy link
Contributor Author

It's a bit strange when I edit line 244 and remove the merc projector it is set to false and it works as it should for the mercator projection but it does not make sense since use_dms will be set to false.

@cvanelteren
Copy link
Contributor Author

I will wait before the issuer gives some clarity. The PR now only contains a test.

@cvanelteren cvanelteren marked this pull request as draft June 28, 2025 20:18
@cvanelteren cvanelteren added this to the v1.57.2 milestone Jun 28, 2025
@cvanelteren cvanelteren added the bug Something isn't working label Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants