Expanding r.mapcalc test coverage - seeking guidance

Hi @annakrat and mentors,

I’ve been reviewing the existing test coverage for GRASS modules as part of my GSoC preparation for the pytest project.

I noticed that r.mapcalc has some tests (in raster/r.mapcalc/testsuite/test_r_mapcalc.py), but they primarily cover:

  • rand() function
  • Basic arithmetic (addition, subtraction)
  • Region operations

However, many important features aren’t tested:

  • Math functions (sqrt, sin, cos, log, exp, etc.)
  • Conditional statements (if-else)
  • Logical operators (&&, ||, !)
  • Comparison operators (>, <, ==, !=)
  • Null value handling (isnull, null())

Question: Would it be valuable to expand the test coverage for r.mapcalc by adding tests for these missing operations? Since r.mapcalc is such a fundamental module, comprehensive test coverage seems important.

I’m happy to work on this if it would be a useful contribution.

Thanks for your guidance!

Sure, but check also the other tests in that folder to not duplicate them. Be mindful of how long the tests run, we have limited CI resources.

1 Like