[GRASS-dev] pyGRASS: ParallelModuleQueue

Martin Landa landa.martin at gmail.com
Wed Nov 30 04:59:01 PST 2016


Hi,

2016-11-30 13:29 GMT+01:00 Martin Landa <landa.martin at gmail.com>:
> Wouldn't make sense to add something like _progress=True. Then module
> could call msgr.percent() automatically when it finish.
>
> queue.percent(5, count) # print each 5%
> module = Module(..., _run=False, _progress=5)
> for ... in ...:
> ...
> queue.wait()

another possibility would be to define own function, eg.

def process(i, n, count):
    Module(..., _run=True, quiet=True)
    msgr.percent(i, n, count)

Similar approach could be useful when for example applying mask and
doing some processing for each scene with multiple bands.

But such function cannot be used together with ParallelModuleQueue. Or
am I wrong? Ma

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa


More information about the grass-dev mailing list