Opened 5 months ago

Closed 5 months ago

#3852 closed defect (fixed)

PyGRASS GridModule silently ignores when module has no output defined

Reported by: martinl Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: PyGRASS Version: unspecified
Keywords: GridModule Cc:
CPU: Unspecified Platform: Unspecified

Description

For modules like G7:r.mapcalc PyGRASS GridModule class fails to work. No output is patched since the module has no output option defined.

from grass.pygrass.modules import Module
from grass.pygrass.modules.grid import GridModule
from grass.pygrass.utils import findmaps
from grass.pygrass.gis import Mapset

Module('g.region', n=1000, s=0, e=1000, w=0, res=1)

grd = GridModule('r.mapcalc',
                 width=250, height=250, overlap=0,
                 processes=4, split=False,
                 expression='out = 1')
grd.run()

print (findmaps('raster', 'out', mapset=str(Mapset())))

Prints

 100%
 100%
 100%
 100%
 100%
 100%
 100%
 100%
 100%
 100%
 100%
 100%
 100%
 100%
 100%
 100%
[]

-> no raster map created. The GridModule should fail at least when no output option is defined.

Change History (2)

comment:2 Changed 5 months ago by martinl

Resolution: fixed
Status: newclosed

Merged

Note: See TracTickets for help on using tickets.