Skip to content

grass.gunittest: Handle null cases in assertRasterMinMax #5440

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

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

Conversation

kritibirda26
Copy link
Contributor

assertRasterMinMax currently fails with a TypeError if either the provided reference values or the actual determined range values are NULL. Update the method to handle NULL cases correctly.

Fixes #3241

assertRasterMinMax currently fails with a TypeError if either the provided
reference values or the actual determined range values are NULL. Update the
method to handle NULL cases correctly.
@github-actions github-actions bot added Python Related code is in Python libraries tests Related to Test Suite labels Mar 24, 2025
@kritibirda26 kritibirda26 changed the title Handle null cases in assertRasterMinMax gunittest: Handle null cases in assertRasterMinMax Mar 24, 2025
@wenzeslaus wenzeslaus changed the title gunittest: Handle null cases in assertRasterMinMax grass.gunittest: Handle null cases in assertRasterMinMax Mar 30, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
simplify boolean checks and use a standard message
to handle precision issues in json output.
@github-actions github-actions bot added raster Related to raster data processing module labels Apr 6, 2025
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.

I agree with the logic in the assert method and the wider range in testing. I have some notes about the test.

refmin=74.75374,
refmax=156.3299,
refmin=74.75373,
refmax=156.3300,
msg="tile-000-000 in degrees must be between 74.75374 and 156.3299",
Copy link
Member

Choose a reason for hiding this comment

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

This needs an update, but actually, deleting should be fine too. The default message will do here. Same below.

kritibirda26 and others added 3 commits April 13, 2025 20:21
Co-authored-by: Vaclav Petras <[email protected]>
kritibirda26 and others added 3 commits April 13, 2025 20:33
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libraries 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.

[Bug] gunittest.TestCase.assertRasterMinMax TypeError if range is NULL
2 participants