Skip to content

r.boxplot: remove debug print statement and add testsuite - #1697

Closed
Valyrian-Code wants to merge 5 commits into
OSGeo:grass8from
Valyrian-Code:grass8
Closed

Valyrian-Code wants to merge 5 commits into
OSGeo:grass8from
Valyrian-Code:grass8

Conversation

@Valyrian-Code

@Valyrian-Code Valyrian-Code commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Remove a leftover print(vect_name) debug statement in bxp_nozones() that leaked an internal Python list directly to stdout, bypassing normal GRASS output handling.
  • Add a testsuite covering:
    • basic output
    • zonal output
    • horizontal orientation
    • missing required input
    • rejection of floating-point zones

Test plan

  • Verify all tests pass:

    python src/raster/r.boxplot/testsuite/test_r_boxplot.py
  • Verify pre-commit checks pass on modified files

Notes

A separate issue (#1696) tracks MASK loss when zones= is used and the script exits with an error. That issue is unrelated to this PR.

Copilot AI review requested due to automatic review settings May 25, 2026 06:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds automated tests for the r.boxplot module and removes an unintended debug print from the implementation.

Changes:

  • Introduce a new Python test suite validating output generation, zonal mode, required parameters, and a flag path.
  • Remove a stray print() call from r.boxplot.py that could pollute stdout.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/raster/r.boxplot/testsuite/test_r_boxplot.py New unit tests covering basic success and failure modes of r.boxplot.
src/raster/r.boxplot/r.boxplot.py Removes a debug print(vect_name) from the outliers-map creation branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

cc @mazingaro, @polucifier & @petrasovaa

echoix
echoix previously approved these changes May 25, 2026
@echoix
echoix dismissed their stale review May 25, 2026 10:47

Accident

@ecodiv ecodiv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The edit in the code is fine. Testsuite looks OK, but I did not test it.

@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

The edit in the code is fine. Testsuite looks OK, but I did not test it.

Thanks. Ran the testsuite locally on GRASS 8.5.0 (conda-forge, osx-arm64) inside an active session. All 5 tests pass:

Ran 5 tests in 2.807s

OK

Tests cover:

  • Basic output
  • Zonal output
  • Horizontal flag
  • Missing required input
  • Float-zones rejection

cc @ecodiv

@echoix

echoix commented Jun 8, 2026

Copy link
Copy Markdown
Member

Oh, as what happened in the grass repo this weekend, this PR is made from the default branch of your fork, and will cause problems. Create a branch specifically for your PR, and open a new PR.

See OSGeo/grass#7515 (comment)

@Valyrian-Code

Copy link
Copy Markdown
Contributor Author

Thanks @echoix, that makes sense. I have reopened this on a dedicated branch as #1729. Closing here in favor of that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants