Skip to content

r.watershed: Add comprehensive regression tests #7029

Open
sumitchintanwar wants to merge 5 commits intoOSGeo:mainfrom
sumitchintanwar:fix/add-existing-tests-r-watershed
Open

r.watershed: Add comprehensive regression tests #7029
sumitchintanwar wants to merge 5 commits intoOSGeo:mainfrom
sumitchintanwar:fix/add-existing-tests-r-watershed

Conversation

@sumitchintanwar
Copy link
Contributor

@sumitchintanwar sumitchintanwar commented Feb 2, 2026

This PR adds a comprehensive suite of regression tests for the r.watershed module, which addresses the changes requested in PR #6953.

The new tests verify accumulation, basin delineation, stream networks, slope metrics, and related outputs to ensure algorithm correctness and regression stability.

All tests were validated using the North Carolina dataset (nc_spm_full_v2beta1)

A few older tests were removed as they became redundant after introducing stronger validation-based tests.

Results:
Before: 6 tests
After: 16 tests, All pass with zero errors.

Addresses requests in #6953.

@github-actions github-actions bot added raster Related to raster data processing Python Related code is in Python module tests Related to Test Suite labels Feb 2, 2026
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

The tests need to go far beyond testing existing of rasters. You need to compute the data and then test against them in the test. Check some other tests we have for other tools. Also, make sure your new tests don't overlap with existing tests. You may also expand existing test if appropriate.

@sumitchintanwar
Copy link
Contributor Author

The tests need to go far beyond testing existing of rasters. You need to compute the data and then test against them in the test. Check some other tests we have for other tools. Also, make sure your new tests don't overlap with existing tests. You may also expand existing test if appropriate.

Got it, I understand. That was my bad, should’ve thought about it earlier. I’m working on the changes and will push them soon.

@sumitchintanwar
Copy link
Contributor Author

sumitchintanwar commented Feb 8, 2026

@wenzeslaus Thanks for the helpful feedback.!!!
I’ve updated the testsuite to compute outputs and validate them against computed data instead of just checking raster existence.
@wenzeslaus @petrasovaa
A quick review would be greatly appreciated whenever you have time. Let me know if anything else should be adjusted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module Python Related code is in Python raster Related to raster data processing tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants