<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 26, 2014 at 6:15 PM, Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><br>
Anna Petrášová wrote:<br>
<br>
> > > How do I use this new flag / seed parameter for r.mapcalc in python<br>
> > > scripts?<br>
> ><br>
> > I'll update the Python interface.<br>
><br>
> How? If we change the interface, I would like to be able to also pass env<br>
> to write_command.<br>
<br>
</div>Do you mean passing arbitrary environment variables through<br>
grass.script.mapcalc() down to the underlying r.mapcalc command?<br>
<br>
Which environment variables would be useful?<br></blockquote><div><br></div><div>For example when you want to parallelize multiple r.mapcalc calls with different region settings. You would copy the environment, change the region (e.g. set WIND_OVERRIDE) or even mapset or location and pass it to r.mapcalc without interfering with the current environment. I can do that now with run_command('r.mapcalc', ..., env=myEnv), it would be just more convenient to have it in the grass.script.mapcalc(). In fact, the same applies to other wrappers in grass.script, for example raster_what. Currently when querying raster in the gui, the GRASS_REGION is changed to match the raster before the query and restored afterwards. In my opinion, it would be just much more elegant (and would require less code) and less error prone, not to change the environment globally but just for the r.what module.</div>

<div><br></div><div><br></div><div>Anna</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><font color="#888888"><br>
--<br>
Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
</font></span></blockquote></div><br></div></div>