[GRASS-dev] pyGRASS send job to background

Hi,

I have several jobs that can be run together,
in BASH we can add "&" at the end of the module command,
is there a pyGRASS option we can throw to the same effect?

Cheers,
Yann
--
----

On Friday 21 Jun 2013 16:20:00 Yann Chemin wrote:

I have several jobs that can be run together,
in BASH we can add "&" at the end of the module command,
is there a pyGRASS option we can throw to the same effect?

yes, the parameter is: finish_=False, in this way python will not wait the end
of the module command...

Sorry I have to add this in the documentation...

Pietro

On Friday 21 Jun 2013 13:08:48 Pietro Zambelli wrote:

Sorry I have to add this in the documentation...

False, it was already in the code... I forgot to activate the foot with the
special parameters... :slight_smile:

Now if you ask for the doc in an interactive shell with:

{{{

i.albedo?

}}}

You get:

{{{
Parameters
----------

input: required, multistring
    Name of input raster map
output: required, string
    Name for output raster map

Flags
------

m: None
    Modis (7 input bands:1,2,3,4,5,6,7)
n: None
    NOAA AVHRR (2 input bands:1,2)
l: None
    Landsat (6 input bands:1,2,3,4,5,7)
a: None
    Aster (6 input bands:1,3,5,6,8,9)
c: None
    Albedo dry run to calculate some water to beach/sand/desert
    stretching, a kind of simple atmospheric correction
d: None
    Albedo dry run to calculate some water to beach/sand/desert
    stretching, a kind of simple atmospheric correction
overwrite: None
    Allow output files to overwrite existing files
verbose: None
    Verbose module output
quiet: None
    Quiet module output

Special Parameters
------------------

The Module class have some optional parameters which are distinct using a
final underscore.

run_: True, optional
    If True execute the module.
finish_: True, optional
    If True wait untill the end of the module execution, and store the module
    outputs into stdout, stderr attributes of the class.
stdin_: PIPE,
    Set the standard input
env_: dictionary, optional
    Set the evironment variables.
}}}

Thank you for the help.

Pietro

Yann wrote:

I have several jobs that can be run together,
in BASH we can add "&" at the end of the module command,
is there a pyGRASS option we can throw to the same effect?

fwiw the "import grass.script" way to do it is demonstrated in
scripts/r3.in.xyz.py and i.landsat.rgb.py scripts.

see also grass.start_command() and raster.mapcalc_start()

Hamish