Repository navigation
Conversation
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1795
Overview
Swaps to an algebraic transformation (
node_lon = (node_lon - central_longitude + 180.0) % 360.0 - 180.0) to shift longitudes, instead of usingcartopy.crs.PlateCarree(...).transform_points(...), to avoid cartopy.crs giving NaNs at the poles, which is what originally triggered #1795.test_plot_with_nonzero_central_longitude()serves as a regression test for this. It loops across many cartopy projections using the new_cartopy_projections()helper function, which I just copy-pasted it directly from the uxarray_debug_utils I've been accumulating while developing uxarray. I know this helper function has more functionality than what is actually being used here, but rather than trim it down I think it is easier to just keep the full version for now, since it is just in the test suite and not user-facing?Along the way, discovered a bug when applying
_central_longitude_of()toObliqueMercatorprojections. The previous behavior was to always silently return 0, ignoring any actually-input central_longitude. This PR fixes_central_longitude_of()to instead handle this case properly (regression test:test_central_longitude_of_for_all_nonlocal_projections()), and also to emit a warning instead of silently returning 0 when central_longitude cannot be determined (updatedtest_central_longitude_of_handles_cartopy_026_platecarree()accordingly, to check for such a warning).PR Checklist
General
Testing & Benchmarking
Documentation and Examples
docs/api.rst; internal (private) function names start with an underscore (_)AI Disclosure
AI Usage: Some Claude to help with debugging, some GitHub Copilot's inline code suggestions.