Skip to content

r.sim: Rename the option random_seed to seed - #8032

Merged
wenzeslaus merged 1 commit into
OSGeo:mainfrom
wenzeslaus:rsim-seed-rename
Oct 7, 2026
Merged

wenzeslaus merged 1 commit into
OSGeo:mainfrom
wenzeslaus:rsim-seed-rename

Conversation

@wenzeslaus

Copy link
Copy Markdown
Member

r.sim.water and r.sim.sediment call their random seed option random_seed. All other random tools and the standard option call it seed, so this renames the option and keeps the old name working through the renamed options list, with the parser's warning.

Follows the r.sim migration (#7980), now merged.

Details (AI generated)

Evidence

  • Eleven tools take a random seed as seed, all through G_OPT_M_SEED: r.mapcalc, r.mapcalc.simple, r.random, r.random.cells, r.random.surface, r.surf.fractal, r.surf.gauss, r.surf.random, v.perturb, v.ppa and v.random. r.sim.water and r.sim.sediment are the only tools with random_seed.
  • Two tools use seed for something else, r.lake for the raster of starting points and i.cluster for the file of initial signatures, so the name is not free of the other meaning, but the convention for the random seed is settled by the standard option.
  • The key under which r.sim: Give each walker random numbers of its own #7980 records the seed in the history and the run summary is seed already, chosen for this rename.
  • The renamed options list has 19 entries for r.sim.sediment and 16 for r.sim.water from the earlier renames, so users of the old name get the same treatment as before: the value is used and the parser warns option <random_seed> has been renamed to <seed>.
  • The rename was suggested in the review of r.sim: Give each walker random numbers of its own #7980.

The change

  • r.sim.water and r.sim.sediment previously defined the standard seed option with its key overridden to random_seed; they now define it as the plain standard option, so the key is seed. The deprecation message of -s now names seed.
  • lib/gis/renamed_options gets random_seed:seed for both tools.
  • The tool docs, the notebook and the tests now use seed. A new test checks that random_seed is still accepted, with the warning, and gives the result of seed.

The code and this description were written with Claude Code (Claude Fable 5.1) and reviewed by the author of the PR.

The random seed is the option seed in the eleven other tools which take
one, all through G_OPT_M_SEED, and only r.sim.water and r.sim.sediment
call it random_seed. The key in the history and the run summary is seed
already. The old name keeps working through the renamed options list,
with the parser's warning, as the earlier renames of these tools do.

Written with the help of Claude Code.
@wenzeslaus
wenzeslaus merged commit 40afb9f into OSGeo:main Oct 7, 2026
26 checks passed
@github-actions github-actions Bot added this to the 8.6.0 milestone Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C docs HTML Related code is in HTML libraries markdown Related to markdown, markdown files module notebook 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.

2 participants