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.buffer: Added test script #4482

Merged
merged 12 commits into from
Nov 8, 2024
Merged

r.buffer: Added test script #4482

merged 12 commits into from
Nov 8, 2024

Conversation

Shreshth-Malik
Copy link
Contributor

This PR adds regression tests for the r.buffer module to ensure its functionality remains intact with future code changes. The following test cases are covered:

test_buffer_creation(): Verifies the creation of buffer zones around raster features based on specified distances. It checks that the output raster exists, has expected category values starting from 1, and that the minimum and maximum values match the expected range.

test_no_non_null_values(): Confirms that the r.buffer module correctly handles an input raster that is entirely null, ensuring the output contains no non-null values.

test_ignore_zero_values(): Ensures that zero values in the input raster are ignored when creating buffer zones, resulting in an output that does not include any zero categories.

@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 Oct 9, 2024
@petrasovaa petrasovaa added this to the 8.5.0 milestone Nov 5, 2024
Reduced the region of the test

Co-authored-by: Anna Petrasova <[email protected]>
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.

See my comment about output maps in #4598 and apply it here too.

@echoix echoix enabled auto-merge (squash) November 8, 2024 04:41
@echoix echoix merged commit 54f2068 into OSGeo:main Nov 8, 2024
26 checks passed
@Shreshth-Malik Shreshth-Malik deleted the r.buffer-test branch November 8, 2024 18:32
a0x8o pushed a commit to a0x8o/grass that referenced this pull request Nov 11, 2024
* Added test script for r.buffer

* Corrected input map and added tearDown method to delete temp maps

* Added pre commit fixes

* Added resolution for feedback

* Tweaked the last test and used f string

* Update raster/r.buffer/testsuite/test_buffer.py

Reduced the region of the test

Co-authored-by: Anna Petrasova <[email protected]>

* Corrected redudancy

* Streamlined output map initialization

---------

Co-authored-by: Anna Petrasova <[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.

3 participants