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

tests: Add regression test for r.his #4572

Merged
merged 7 commits into from
Oct 25, 2024
Merged

Conversation

mshukuno
Copy link
Contributor

@mshukuno mshukuno commented Oct 22, 2024

Description

Added regression test for r.his.

Motivation and context

There was no testing for r.his.

How has this been tested?

Locally tested with python <path>/raster/r.his/testsuite/test_r_his.py

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to not work as before)
  • New test (non-breaking change which adds test)

Checklist

  • PR title provides summary of the changes and starts with one of the
    pre-defined prefixes
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@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 22, 2024
@petrasovaa
Copy link
Contributor

Failing with

======================================================================
FAIL: test_bgcolor_none (__main__.TestRHis)
Test r.his with bgcolor 'none'
----------------------------------------------------------------------
Traceback (most recent call last):
  File "raster/r.his/testsuite/test_r_his.py", line 50, in test_bgcolor_none
    self.assertRasterFitsUnivar(
  File "etc/python/grass/gunittest/case.py", line 290, in assertRasterFitsUnivar
    self.assertModuleKeyValue(
  File "etc/python/grass/gunittest/case.py", line 272, in assertModuleKeyValue
    self.fail(self._formatMessage(msg, stdMsg))
AssertionError: r.univar map=shadedmap_r percentile=90.0 nprocs=1 separator== format=plain -g difference:
mismatch values (key, reference, actual): [('max', 255, 198), ('mean', 156.41168, 158.437142857143), ('min', 3, 106), ('null_cells', 5696, 1009900), ('stddev', 34.434612, 30.7161715035702)]
command: r.univar map=shadedmap_r percentile=90.0 nprocs=1 separator== format=plain -g {'map': 'shadedmap_r', 'separator': '=', 'flags': 'g'}

======================================================================
FAIL: test_with_bgcolor_rgb (__main__.TestRHis)
Test r.his with bgcolor '0:0:0'
----------------------------------------------------------------------
Traceback (most recent call last):
  File "raster/r.his/testsuite/test_r_his.py", line 76, in test_with_bgcolor_rgb
    self.assertRasterFitsUnivar(
  File "etc/python/grass/gunittest/case.py", line 290, in assertRasterFitsUnivar
    self.assertModuleKeyValue(
  File "etc/python/grass/gunittest/case.py", line 272, in assertModuleKeyValue
    self.fail(self._formatMessage(msg, stdMsg))
AssertionError: r.univar map=shadedmap_r percentile=90.0 nprocs=1 separator== format=plain -g difference:
mismatch values (key, reference, actual): [('max', 255, 198), ('mean', 155.97172, 0.109742727092816), ('stddev', 35.36988, 4.24603246352255)]
command: r.univar map=shadedmap_r percentile=90.0 nprocs=1 separator== format=plain -g {'map': 'shadedmap_r', 'separator': '=', 'flags': 'g'}

echoix
echoix previously approved these changes Oct 23, 2024
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

I didn't analyze to look for what isn't there, but what is there makes sense ;)

Thanks for a new test on a module that didn't have some yet!

@petrasovaa petrasovaa added this to the 8.5.0 milestone Oct 23, 2024
Apply the suggestion.

Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Apply the suggestion.

Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Black styling

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@echoix echoix merged commit b6514ca into OSGeo:main Oct 25, 2024
26 checks passed
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