Skip to content

r.fill.stats: migrate tests from gunittest to pytest - #7894

Draft
Valyrian-Code wants to merge 2 commits into
OSGeo:mainfrom
Valyrian-Code:r.fill.stats-pytest
Draft

r.fill.stats: migrate tests from gunittest to pytest#7894
Valyrian-Code wants to merge 2 commits into
OSGeo:mainfrom
Valyrian-Code:r.fill.stats-pytest

Conversation

@Valyrian-Code

@Valyrian-Code Valyrian-Code commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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.

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.

1 participant