Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9065926
Add flags parameter to mapcalc and mapcalc_start
y-sudharshan Dec 11, 2025
5384e60
tests for mapcalc() with seed and flags parameter
y-sudharshan Dec 11, 2025
e5961c5
Auto-seed by default and remove deprecated seed='auto' parameter
y-sudharshan Dec 12, 2025
f150aa4
flags parameter support and handle deprecated seed=auto
y-sudharshan Dec 13, 2025
483ffa8
Merge branch 'main' into fix/mapcalc-flags-parameter
echoix Dec 13, 2025
e584e22
Merge branch 'main' into fix/mapcalc-flags-parameter
echoix Dec 13, 2025
e8ad826
Merge branch 'main' into fix/mapcalc-flags-parameter
echoix Dec 13, 2025
bf3efb7
rand() function when no explicit seed provided
y-sudharshan Dec 14, 2025
b35241c
Merge remote-tracking branch 'origin/fix/mapcalc-flags-parameter'
y-sudharshan Dec 14, 2025
6c32923
assigning priority to seed value when bith flag(s) and seed values ar…
y-sudharshan Dec 15, 2025
926e718
Merge branch 'main' into fix/mapcalc-flags-parameter
y-sudharshan Dec 15, 2025
cef826c
native auto-seeding in C code
y-sudharshan Dec 16, 2025
64199cc
Merge remote-tracking branch 'origin/fix/mapcalc-flags-parameter'
y-sudharshan Dec 16, 2025
21f82e8
Merge branch 'main' into fix/mapcalc-flags-parameter
y-sudharshan Dec 16, 2025
d784a3c
stop forwarding flags parameter
y-sudharshan Dec 17, 2025
9b08766
update r.mapcalc Python API tests for wrapper refactoring
y-sudharshan Dec 17, 2025
66346af
format
y-sudharshan Dec 17, 2025
217dbf3
Merge branch 'origin/fix/mapcalc-flags-parameter' into fix/mapcalc-fl…
y-sudharshan Dec 17, 2025
f9d2abe
Remove flags parameter from mapcalc and mapcalc_start function
y-sudharshan Dec 18, 2025
c831675
Merge branch 'main' into fix/mapcalc-flags-parameter
echoix Dec 18, 2025
062d2fd
Add backwards compatibility for seed='auto' in mapcalc functions
y-sudharshan Dec 18, 2025
136d23a
Merge remote-tracking branch 'origin/fix/mapcalc-flags-parameter'
y-sudharshan Dec 18, 2025
76ac729
line adjust
y-sudharshan Dec 18, 2025
d575ccd
comprehensive seed handling tests
y-sudharshan Dec 20, 2025
eb0cd76
replaced raster2numpy with environment aware helper and added windows…
y-sudharshan Dec 21, 2025
62b7a32
time delay and temp file management
y-sudharshan Dec 22, 2025
d03a68d
Merge branch 'main' into fix/mapcalc-flags-parameter
echoix Dec 22, 2025
f60af2a
mark invalid seed test as xfail
y-sudharshan Dec 24, 2025
30f1965
Merge branch 'main' into fix/mapcalc-flags-parameter
echoix Dec 26, 2025
a5bedb5
Refactor mapcalc rand tests: parametrize edge seed tests for better e…
y-sudharshan Jan 4, 2026
3a9f3c2
scope and test refactor
y-sudharshan Jan 7, 2026
4ec4229
session attribute handling
y-sudharshan Jan 7, 2026
33db8c4
flag and format check
y-sudharshan Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions python/grass/script/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import os
import string
import time
from pathlib import Path

from .core import (
Expand Down Expand Up @@ -135,14 +134,14 @@ def mapcalc(
:param bool verbose: True to run verbosely (``--v``)
:param bool overwrite: True to enable overwriting the output (``--o``)
:param seed: an integer used to seed the random-number generator for the
rand() function, or 'auto' to generate a random seed
rand() function. If not provided, r.mapcalc uses automatic seeding.
:param nprocs: Number of threads for parallel computing
:param dict env: dictionary of environment variables for child process
:param kwargs:
"""

# Handle backwards compatibility: convert seed="auto" to None
if seed == "auto":
seed = hash((os.getpid(), time.time())) % (2**32)
seed = None

t = string.Template(exp)
e = t.substitute(**kwargs)
Expand Down Expand Up @@ -210,16 +209,16 @@ def mapcalc_start(
:param bool verbose: True to run verbosely (``--v``)
:param bool overwrite: True to enable overwriting the output (``--o``)
:param seed: an integer used to seed the random-number generator for the
rand() function, or 'auto' to generate a random seed
rand() function. If not provided, r.mapcalc uses automatic seeding.
:param nprocs: Number of threads for parallel computing
:param dict env: dictionary of environment variables for child process
:param kwargs:

:return: Popen object
"""

# Handle backwards compatibility: convert seed="auto" to None
if seed == "auto":
seed = hash((os.getpid(), time.time())) % (2**32)
seed = None

t = string.Template(exp)
e = t.substitute(**kwargs)
Expand Down
Loading
Loading