Skip to content

Keep seam faces in polygon plots#1519

Open
rajeeja wants to merge 2 commits into
mainfrom
rajeeja/fix-ne30pg2-seam-plot
Open

Keep seam faces in polygon plots#1519
rajeeja wants to merge 2 commits into
mainfrom
rajeeja/fix-ne30pg2-seam-plot

Conversation

@rajeeja
Copy link
Copy Markdown
Contributor

@rajeeja rajeeja commented May 29, 2026

Summary

  • use split seam handling by default for shaded polygon plots
  • add ne30pg2 coverage for seam-crossing faces

Closes #1518

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Copy Markdown
Contributor

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 addresses seam/antimeridian artifacts in face-centered shaded polygon plots by changing the default periodic-element handling to preserve seam-crossing faces, and adds regression coverage for the NE30PG2 SCRIP tutorial dataset.

Changes:

  • Switch UxDataArray.plot.polygons() (and thus UxDataArray.plot() for face-centered data) to default periodic_elements="split" so seam-crossing faces are not dropped.
  • Add a NE30PG2 regression test intended to ensure antimeridian faces are preserved when using split handling.
  • Update plotting documentation to reflect the new default and show explicit exclude vs split examples.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
uxarray/plot/accessor.py Changes default polygon plotting behavior to split periodic (seam-crossing) faces and updates docstring text.
test/core/test_dataarray.py Adds a NE30PG2 regression test for split periodic handling (with a few correctness/naming adjustments needed).
docs/user-guide/plotting.ipynb Updates user-guide narrative and examples to match the new default and recommended options.
docs/user-guide/mpl.ipynb Clarifies Matplotlib to_polycollection() default periodic handling in the docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread uxarray/plot/accessor.py
Comment on lines +392 to 396
Specifies whether to split, include, or exclude periodic elements in the grid.
Options are:
- "exclude": Exclude periodic elements,
- "split": Split periodic elements.
- "exclude": Exclude periodic elements,
- "ignore": Include periodic elements without any corrections
datasetpath("scrip", "ne30pg2", "data.nc"),
)

gdf = uxds["RELHUM"].isel(lev=0).to_geodataframe(periodic_elements="split")
assert len(pc_geoflow_grid._paths) == uxds_geoflow.uxgrid.n_face


def test_plot_polygons_preserves_antimeridian_faces(gridpath, datasetpath):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not drop seam-crossing faces in polygon plots

2 participants