[GRASS-dev] [GRASS GIS] #3691: addon r.connectivity.distance not working

#3691: addon r.connectivity.distance not working
---------------------+-------------------------
Reporter: cgarzon | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: 7.4.1
Keywords: | CPU: OSX/Intel
Platform: MacOSX |
---------------------+-------------------------
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?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3691&gt;
GRASS GIS <https://grass.osgeo.org>

#3691: addon r.connectivity.distance not working
------------------------+-------------------------
  Reporter: cgarzon | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Addons | Version: 7.4.1
Resolution: | Keywords:
       CPU: OSX/Intel | Platform: MacOSX
------------------------+-------------------------
Description changed by neteler:

Old description:

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?

New description:

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?

--

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3691#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3691: addon r.connectivity.distance not working
------------------------+-------------------------
  Reporter: cgarzon | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Addons | Version: 7.4.1
Resolution: | Keywords:
       CPU: OSX/Intel | Platform: MacOSX
------------------------+-------------------------

Comment (by neteler):

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

Replying to [ticket:3691 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...

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3691#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3691: addon r.connectivity.distance not working
------------------------+-------------------------
  Reporter: cgarzon | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Addons | Version: 7.4.1
Resolution: | Keywords:
       CPU: OSX/Intel | Platform: MacOSX
------------------------+-------------------------

Comment (by 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...).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3691#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3691: addon r.connectivity.distance not working
------------------------+----------------------------
  Reporter: cgarzon | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.3
Component: Addons | Version: 7.4.1
Resolution: | Keywords: r.connectivity
       CPU: OSX/Intel | Platform: MacOSX
------------------------+----------------------------
Changes (by sbl):

* cc: sbl (added)
* keywords: => r.connectivity
* milestone: => 7.4.3

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3691#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3691: addon r.connectivity.distance not working
------------------------+----------------------------
  Reporter: cgarzon | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.3
Component: Addons | Version: 7.4.1
Resolution: | Keywords: r.connectivity
       CPU: OSX/Intel | Platform: MacOSX
------------------------+----------------------------

Comment (by neteler):

Replying to [comment:3 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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3691#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3691: addon r.connectivity.distance not working
------------------------+----------------------------
  Reporter: cgarzon | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Addons | Version: 7.4.1
Resolution: | Keywords: r.connectivity
       CPU: OSX/Intel | Platform: MacOSX
------------------------+----------------------------

Comment (by sbl):

In [changeset:"74437" 74437]:
{{{
#!CommitTicketReference repository="" revision="74437"
backport tempname function, see #3691
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3691#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>

#3691: addon r.connectivity.distance not working
------------------------+----------------------------
  Reporter: cgarzon | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.8.3
Component: Addons | Version: 7.4.1
Resolution: fixed | Keywords: r.connectivity
       CPU: OSX/Intel | Platform: MacOSX
------------------------+----------------------------
Changes (by sbl):

* status: new => closed
* resolution: => fixed

Comment:

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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3691#comment:11&gt;
GRASS GIS <https://grass.osgeo.org>