[GRASS-dev] latest r.width.funct.py appears to be broken

On Thu, Nov 1, 2018 at 6:35 PM Bartolomei.Chris <Bartolomei.Chris@ensco.com> wrote:

Good afternoon Markus & Co. :blush:

It appears that the latest version of r.width.funct.py is not functioning properly ā€¦ We have a few Windows10 systems here running GRASS; Iā€™m on v7.4.0 and another person has (had) 7.2.2. She was trying to run r.basin on a 30m resolution DEM and kept getting the following error:

Traceback (most recent call last):
File ā€œC:\Users\XXX\AppData\Roaming\GRASS7\addons/scripts/r.width.funct.pyā€, line 135, in
sys.exit(main())
File ā€œC:\Users\XXX\AppData\Roaming\GRASS7\addons/scripts/r.width.funct.pyā€, line 84, in main
prc[0,0] , prc[0,1] = findint(kl,0.05) , 0.05
File ā€œC:\Users\XXX\AppData\Roaming\GRASS7\addons/scripts/r.width.funct.pyā€, line 128, in findint
z1, z2, f1, f2 = kl[int(Xf[0])][0], kl[int(Xf[0]-1)][0], kl[int(Xf[0])][1], kl[int(Xf[0]-1)][1]
IndexError: invalid index to scalar variable.

This was fixed the other day by madi :slight_smile:

2018-10-23 03:26:54 -0700 (Tue, 23 Oct 2018)
New Revision: 73602

To get that, just reinstall the addon with g.extension.

Best
Markus

PS: thanks anyway for the updated script! The author solved it in a slightly different way.

ā€“
Markus Neteler, PhD
http://www.mundialis.de - free data with free software
http://grass.osgeo.org
http://courses.neteler.org/blog