Re: [GRASS-dev] python question

2012-06-24 Thread Anna Kratochvílová
Hi, On Sat, Jun 23, 2012 at 9:48 PM, Michael Barton michael.bar...@asu.edu wrote: This is probably simple but I'm missing something somewhere. How can I dynamically create variable names and then assign values to the variables? I need to do something along the lines of: for i in flist:

Re: [GRASS-dev] pthreads in r.mapcalc slower than without

2012-06-24 Thread Glynn Clements
Hamish wrote: I've just been running some benchmarks for r.mapcalc to try and find the best method for parallelizing a script / best way to minimize overheads. I'd like to understand where it is useful to combine expressions into a single r.mapcalc process, and where it isn't, If the

Re: [GRASS-dev] python question

2012-06-24 Thread Glynn Clements
Michael Barton wrote: This is probably simple but I'm missing something somewhere. How can I dynamically create variable names and then assign values to the variables? I need to do something along the lines of: for i in flist: 's%_new' % i = 10 where flist is a list of strings

Re: [GRASS-dev] python question

2012-06-24 Thread Michael Barton
Thanks Anna and Glynn, I got the same advice from a colleague here: use a dictionary. Works perfectly to resolve the problem. Michael Barton School of Human Evolution Social Change Center for Social Dynamics Complexity Arizona State University ...Sent from my iPad On Jun 24, 2012, at 1:56

[GRASS-dev] grass.mapcalc() python wrapper using grass.start_command()

2012-06-24 Thread Hamish
Hi, in making some of the python modules multithreaded, it would be useful to have a version of grass.mapcalc() which didn't wait until it was done, and returned the Popen object instead. e.g. to process three r,g,b bands in parallel. I just added an experimental grass.mapcalc_start() fn to