Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.basins.fill: Fix Broken Tests and Preserve Test Dataset Integrity #5198

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

NishantBansal2003
Copy link
Contributor

Overview:
This PR resolves issues in the r.basins.fill module tests as outlined in ticket #3822. It applies the patch provided in testrbf_fix_mapnames.diff to address broken tests.

Key Changes:

  • The patch from ticket 3822 has been applied to correct broken tests in r.basins.fill.

  • Previously, the tests would overwrite the "elevation" and "geology_30m" maps, corrupting the test dataset. This PR now creates copies of these maps before processing, ensuring the original test data remains intact.

  • With the fixes in place, the temporary workaround using @unittest.skip("See #3822") is no longer necessary and can be removed.

@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 23, 2025
@petrasovaa
Copy link
Contributor

Well, looking more into it, this entire test is pretty much useless. So I would either rewrite it completely or drop it.

@NishantBansal2003
Copy link
Contributor Author

Well, looking more into it, this entire test is pretty much useless. So I would either rewrite it completely or drop it.

Oh, let me rewrite this then. I'll update once it's done.

@NishantBansal2003 NishantBansal2003 marked this pull request as draft February 25, 2025 06:41
@NishantBansal2003 NishantBansal2003 marked this pull request as ready for review February 26, 2025 05:30
@NishantBansal2003
Copy link
Contributor Author

Well, looking more into it, this entire test is pretty much useless. So I would either rewrite it completely or drop it.

Hey @petrasovaa, I rewrote the tests. Can you take a look?

Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

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

Thank you, this is much better! I tried to run it and I suggest:

  • reduce computational region (resolution or extent) , the test runs almost 20s on my computer, which is unnecessarily long. No need for g.region print flag here.
  • it expects zeros, not nulls in stream raster (this tool was written long time ago when nulls were not even implemented). You can use r.null here.

petrasovaa
petrasovaa previously approved these changes Mar 3, 2025
Signed-off-by: Nishant Bansal <[email protected]>
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.

2 participants