Opened 6 years ago

Closed 4 years ago

#3691 closed defect (fixed)

addon r.connectivity.distance not working

Reported by: cgarzon Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Addons Version: 7.4.1
Keywords: r.connectivity Cc: sbl
CPU: OSX/Intel Platform: MacOSX

Description (last modified by neteler)

I have installed the addon r.connectivity. But when I try to use r.connectivity.distance I get the following error:

GRASS 7.4.1 (nc_spm_08_grass7):~ > r.connectivity.distance

Traceback (most recent call last):

  File "/Users/carolgarzon/Library/GRASS/7.4/Modules/scripts/r.connectivity.distance", line 242, in <module>

    TMP_PREFIX = grass.tempname(12)

AttributeError: 'module' object has no attribute 'tempname'

--------

There is no manual page for this command and when I tried reinstalling I got:



ADVERTENCIA: Extension <r.connectivity> already installed. Re-installing...

Fetching <r.connectivity> from GRASS GIS Addons repository (be patient)...

Compiling...

Traceback (most recent call last):

  File "/tmp/grass7-carolgarzon-7044/tmp_ooFcV/r.connectivity/scripts/r.connectivity.distance", line 242, in <module>

    TMP_PREFIX = grass.tempname(12)

AttributeError: 'module' object has no attribute 'tempname'

make[1]: *** [r.connectivity.distance.tmp.html] Error 1

Installing...

install: /tmp/grass7-carolgarzon-7044/tmp_ooFcV/r.connectivity/docs/html/r.connectivity.distance.html: No such file or directory

make[1]: *** [install] Error 71

Updating addons metadata file...

Installation of <r.connectivity> successfully finished

What might be the problem?

Change History (11)

in reply to:  description comment:1 by neteler, 6 years ago

Description: modified (diff)

comment:2 by neteler, 6 years ago

(minor wish: please use the "Code Block" button in the editor for citing terminal output for better readability)

Replying to cgarzon:

I have installed the addon r.connectivity. But when I try to use r.connectivity.distance I get the following error:

GRASS 7.4.1 (nc_spm_08_grass7):~ > r.connectivity.distance

Traceback (most recent call last):

File "/Users/carolgarzon/Library/GRASS/7.4/Modules/scripts/r.connectivity.distance", line 242, in <module>

TMP_PREFIX = grass.tempname(12)

AttributeError: 'module' object has no attribute 'tempname'

It seems that an import is missing to enable:

https://grass.osgeo.org/grass76/manuals/libpython/script.html?highlight=tempname#script.core.tempname

The author may know best...

comment:3 by sbl, 6 years ago

Yes, the addon is developed against upcoming 7.6 and the tempname() function is not part of 7.4.

Options would be
a) to backport it to 7.4 (its a new feature but a minor change with little risk...) or
b) to (at least temporarily) add the function to the addon, together wih a check for GRASS version

What would be the prefered solution from the core-devs perspective? Option a) would solve the issue first with next point release (7.4.3), option b) would create some mess in the addon code (that could be removed later...).

comment:4 by sbl, 6 years ago

Cc: sbl added
Keywords: r.connectivity added
Milestone: 7.4.3

in reply to:  3 comment:5 by neteler, 6 years ago

Replying to sbl:

Yes, the addon is developed against upcoming 7.6 and the tempname() function is not part of 7.4.

Options would be
a) to backport it to 7.4 (its a new feature but a minor change with little risk...) or
b) to (at least temporarily) add the function to the addon, together wih a check for GRASS version

What would be the prefered solution from the core-devs perspective? Option a) would solve the issue first with next point release (7.4.3), option b) would create some mess in the addon code (that could be removed later...).

I'd go both ways: backport r73205 (found with trac - source code browser - "blame" function) to relbranch74 and also add it for now to the addon code. Then remove once 7.4.3 is out.

comment:6 by martinl, 6 years ago

Milestone: 7.4.37.4.4

Bump milestone to 7.4.4

comment:7 by neteler, 6 years ago

Milestone: 7.4.47.4.5

Ticket retargeted after milestone closed

comment:8 by martinl, 6 years ago

Milestone: 7.4.5

Remove Milestone from Addons bugreports.

comment:9 by sbl, 6 years ago

In 74437:

backport tempname function, see #3691

comment:10 by neteler, 5 years ago

Milestone: 7.8.3

comment:11 by sbl, 4 years ago

Resolution: fixed
Status: newclosed

After backport and with 7.8 being stable version this can be closed, I guess.

Note: See TracTickets for help on using tickets.