r.fill.stats: migrate tests from gunittest to pytest - #7894
Draft
Valyrian-Code wants to merge 2 commits into
Draft
r.fill.stats: migrate tests from gunittest to pytest#7894Valyrian-Code wants to merge 2 commits into
Valyrian-Code wants to merge 2 commits into
Conversation
This was referenced Sep 5, 2026
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.
Migrates the r.fill.stats testsuite from gunittest to pytest, continuing the one-at-a-time migrations from #7635/#7675/#7780/#7893.
Same input and reference outputs as before, now inlined and compared cell by cell with numpy instead of through a difference raster.
Found one discrepancy while doing that: the reference data has the northeast corner cell as null in all four modes, but the tool currently fills it in all four, with a different value per mode (as expected, since each mode computes a different statistic). Every other cell matches the old reference exactly, to float64 precision.
The old test's assertRastersNoDifference could not have caught this: it checks the range of a difference raster, and a difference against a null cell is itself null, so it gets excluded from that range check.
No relevant change to the fill algorithm since this test was added in 2013 explains the corner behavior, so I believe the original reference was wrong for that one cell. This test asserts the corner's current value explicitly rather than reusing the old expectation. Happy to open a separate issue if that seems worthwhile.
Verified locally, all four cases pass.