to_raster: handle unset extent; accept singleton extra dims by rajeeja · Pull Request #1420 · UXARRAY/uxarray · GitHub
Skip to content

to_raster: handle unset extent; accept singleton extra dims#1420

Merged
rajeeja merged 18 commits into
mainfrom
rajeeja/fix_issue1393
Dec 19, 2025
Merged

to_raster: handle unset extent; accept singleton extra dims#1420
rajeeja merged 18 commits into
mainfrom
rajeeja/fix_issue1393

Conversation

@rajeeja

@rajeeja rajeeja commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

Thanks to @brianpm for reporting #1393. This PR fixes #1393 that axes extent must be set before calling to_raster, and fixes the flat-output issue by auto-detecting default axes limits and setting a reasonable extent from grid lon/lat bounds when needed (with a warning). It also adds support for data with extra length-1 dimensions by allowing singleton dims and squeezing to (n_face,) before rasterization.

@rajeeja rajeeja requested a review from erogluorhan December 8, 2025 18:34
@rajeeja

rajeeja commented Dec 12, 2025

Copy link
Copy Markdown
Contributor Author

@erogluorhan

Copy link
Copy Markdown
Member

@rajeeja rajeeja force-pushed the rajeeja/fix_issue1393 branch from 64602f1 to e8c5198 Compare December 17, 2025 19:15
@erogluorhan erogluorhan linked an issue Dec 17, 2025 that may be closed by this pull request
@rajeeja rajeeja changed the title Allow to_raster to handle singleton extra dims and fix flat output to_raster: handle unset extent; accept singleton extra dims Dec 17, 2025

@erogluorhan erogluorhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is looking great and almost there; please see my comments below.

Comment thread uxarray/core/dataarray.py Outdated
Comment thread uxarray/core/dataarray.py Outdated
Comment thread uxarray/core/dataarray.py Outdated
Comment thread test/test_plot.py Outdated
@erogluorhan erogluorhan self-requested a review December 19, 2025 19:26

@erogluorhan erogluorhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me! Please fix the link-check and merge

@rajeeja rajeeja merged commit b688ed5 into main Dec 19, 2025
13 checks passed
@erogluorhan erogluorhan deleted the rajeeja/fix_issue1393 branch February 18, 2026 20:51
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.

to_raster producing all the same value

2 participants