Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for using Cartopy's Geodetic projection as a source CRS and implements a new polygons plotting method to shade grid faces by their index. Key changes include:
- The introduction of the check_crs helper function in utils.py to handle CRS adjustments.
- Modifications to the edges and mesh methods and the addition of a new polygons method in accessor.py.
- Updates to the test suite (test_plot.py) to cover these new functionalities.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| uxarray/plot/utils.py | Added check_crs function for CRS handling |
| uxarray/plot/accessor.py | Updated edges, mesh; added polygons method with CRS adjustments and raster settings |
| test/test_plot.py | Extended tests to cover new polygons plotting and Geodetic projection usage |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
erogluorhan
requested changes
May 3, 2025
Member
erogluorhan
left a comment
There was a problem hiding this comment.
This is great! Some thoughts on a few things though:
- The name
grid.plot.polygons()can potentially be confused with ourpolygons()visualizations that plot data values based polygons instead.- How about renaming it from
polygonsto something else?- Just an idea: This is only for topology diagnostics purposes, right? Maybe something to emphasize this aspect better, which'd also help avoid confusions with the other polygons? e.g.
grid.plot.shade_faces(), etc?
- Just an idea: This is only for topology diagnostics purposes, right? Maybe something to emphasize this aspect better, which'd also help avoid confusions with the other polygons? e.g.
- How about renaming it from
- In addition to renaming, if still needed, maybe also consider either adding a bigger emphasis on the purpose of this plotting function into the docstrings or displaying a warning message when this is called
- Values in the color bars in both cases of
fillargument for this function do not make much sense, e.g. face indices being float, or those float values around 1 when it is polygons.
ccrs.Geodetic source projection, add Polygon plot to Grid ccrs.Geodetic source projection, add Polygon plot to Grid
Member
Author
|
Closing this, as the |
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 #1230
Overview
Geodeticprojection as a source projection, allowing for better visualization of grids on the surface of a sphere and for handling splitting along the dateline: shapes crossing the dateline are not plotted correctly holoviz/geoviews#107Grid.plot.polygons()method that plots shaded polygons using the index of each face.Examples
No Source Projection
Geodetic Source Projection