Skip to content

r.soillossbare: restore the user's region with a temporary region#1742

Open
Valyrian-Code wants to merge 3 commits into
OSGeo:grass8from
Valyrian-Code:r.soillossbare-use-temp-region
Open

r.soillossbare: restore the user's region with a temporary region#1742
Valyrian-Code wants to merge 3 commits into
OSGeo:grass8from
Valyrian-Code:r.soillossbare-use-temp-region

Conversation

@Valyrian-Code

Copy link
Copy Markdown
Contributor

Part of #1741.

r.soillossbare sets the computational region to its own working resolution (g.region -a res=...) as the first thing it does, but it never restores it, so after the module runs the user is left with their region silently changed.

This wraps the change in gs.use_temp_region(), which restores the user's original region automatically on exit (including on error). This is the standard GRASS pattern for modules that set their own region.

I also added a testsuite. It fails without the fix (the region is left at the module's resolution) and passes with it. Verified locally on GRASS 8.5.

This is the first example from the #1741 cleanup. Happy to work through the rest at whatever pace suits, coordinating with each addon's author.

r.soillossbare set the computational region to its own working resolution
via "g.region -a res=..." but never restored it, so after the module ran the
user was left with their region resolution silently changed.

Use gs.use_temp_region() so the original region is restored automatically on
exit, including on error. Add a testsuite that fails without the fix (the
region is left at the module's resolution) and passes with it.
Copilot AI review requested due to automatic review settings June 9, 2026 19:25

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants