Skip to content

r.watershed: Add comprehensive regression tests #7029

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

r.watershed: Add comprehensive regression tests #7029
sumitchintanwar wants to merge 3 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 tests are designed to verify the consistency of output rasters, correct parameter handling (including memory and convergence settings), and the proper function of specific flags.

All tests were validated using the North Carolina sample dataset (nc_spm_08_grass7)

Results:
Before: 6 tests (2 errors)
After: 15 tests (added 9 tests, no errors) (2 errors on existing tests with the nc dataset)
All 9 newly added tests pass with 0 error.

Notes: The two existing tests(test_thresholdsize, test_basinValue) failed on the north carolina dataset as it gave a different maximum value for the basin.

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.

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