<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 11, 2015 at 12:37 PM, Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
In a python script I have the following call:<br>
<br>
grass.run_command('r.series',<br>
                   input = rate_maps,<br>
                   output = sum_rates,<br>
                   method = 'sum',<br>
                   overwrite = True,<br>
                   quiet=True)<br>
<br>
rate_maps is a list which in one instance contains 8559 map names, leading to an "OSError: [Errno 7] Argument list too long".<br>
<br>
I know that in the shell I could use xargs to work around such a problem. But how to do this in python ?<br>
<br>
I could obviously loop through all maps and thus sum them individually, but this just seems horribly inefficient.<br>
<br>
Does anyone have a better solution ?<br>
<br>
Moritz<br>
<br></blockquote><div><br></div><div>It seems we are hitting these issues quite often, we should consider add input file as an option like many temporal modules already have. But splitting as Nikos suggests has the advantage that you can parallelize the computation.</div><div><br></div><div>Anna</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</blockquote></div><br></div></div>