Skip to content

Fix Affine matrix multiplication warnings - #939

Open
be-student wants to merge 11 commits into
corteva:masterfrom
be-student:codex/937-affine-matmul
Open

be-student wants to merge 11 commits into
corteva:masterfrom
be-student:codex/937-affine-matmul

Conversation

@be-student

@be-student be-student commented Sep 6, 2026

Copy link
Copy Markdown

Summary

Fixes the PendingDeprecationWarning raised by Affine 3 when rioxarray uses * for matrix multiplication. Pixel-center and recalculated transforms now use @, while coordinate-array transforms use explicit coefficient arithmetic so rectilinear and rotated/sheared results remain unchanged.

The compatible dependency floors are now explicit:

  • rasterio>=1.5.1
  • affine>=3

Validation

  • Focused unit tests: 2 passed.
  • Affected transform integration tests: 30 passed.
  • git diff --check: passed.

Exact tested head: 127d5af29d000608a9575a62bd4de4d3651459de.

Issue linkage

AI assistance disclosure

OpenAI Codex assisted with implementation, test design, and preparation of this pull request text. The validation results above were run against the exact head listed in this description.

Comment thread test/unit/test_spatial_utils.py Outdated
Comment thread test/unit/test_unit_reproject_match.py Outdated
@snowman2

Copy link
Copy Markdown
Member

With this change, will need to pin rasterio>=1.5.1 and affine>=3.

@snowman2

Copy link
Copy Markdown
Member

I suggest focusing only on affine matrix multiplication. If more than that is added, it could cause the PR merge to be delayed or blocked.

@be-student

Copy link
Copy Markdown
Author

Thanks for the guidance. I narrowed the branch back to the affine matrix multiplication change and the requested rasterio>=1.5.1 / affine>=3 dependency floors. The unrelated shutdown handling and AppVeyor exit-code wrapper have been removed, and AppVeyor runs pytest directly again.

At head 127d5af29d000608a9575a62bd4de4d3651459de, the focused unit tests pass (2 passed), the affected transform integration tests pass (30 passed), and git diff --check passes. The fresh AppVeyor build is now running.

@be-student

Copy link
Copy Markdown
Author

AppVeyor build 54750988 completed the full Windows suite on the narrowed head: 554 passed, 4 skipped, 2 xfailed, and 5 xpassed. After pytest printed the successful summary, the interpreter emitted empty sys.excepthook messages and exited with Windows access violation -1073741819 (0xC0000005). No test failed, including the affine coverage.

I am keeping the branch affine-only as requested and am not reintroducing shutdown hooks or a CI wrapper that accepts the native crash. The complete hosted log is available in AppVeyor build 54750988.

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.

rioxarray.open_rasterio starting to emit warning from affine

2 participants