[GRASS-dev] [GRASS GIS] #3058: unexpected behavior/error message in r.diversity?

#3058: unexpected behavior/error message in r.diversity?
------------------------+-------------------------
Reporter: veroandreo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.2.0
Component: Addons | Version: svn-trunk
Keywords: | CPU: x86-64
Platform: Linux |
------------------------+-------------------------
I had assumed as in the last example of
[https://grass.osgeo.org/grass70/manuals/addons/r.diversity.html
r.diversity] manual that if I used only 'exclude' it would pick up that I
wanted the other three methods. This was the command I used and the error,
even though I was using only 'exclude':

{{{
r.diversity input=my_classif prefix=diverity size=3 exclude=renyi
ERROR: You can either use 'method' or 'exclude' option but not both
}}}

Anyway, the complementary did work :slight_smile:

{{{
r.diversity input=my_classif prefix=diver size=3
method=simpson,shannon,pielou
}}}

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

#3058: unexpected behavior/error message in r.diversity?
-------------------------+-------------------------
  Reporter: veroandreo | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Addons | Version: svn-trunk
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
-------------------------+-------------------------

Comment (by veroandreo):

Found another error that does not fit what manual page says. If I use
"size=5-9" as it seems to be allowed according to
[https://grass.osgeo.org/grass70/manuals/addons/r.diversity.html
r.diversity] examples, I get the following error:

{{{
GRASS 7.3.svn (lat_long):~ > r.diversity input=my_classif prefix=diver
size=5-9 method=simpson
Traceback (most recent call last):
   File "/home/veroandreo/.grass7/addons/scripts/r.diversity", line 283, in
<module>
     sys.exit(main())
   File "/home/veroandreo/.grass7/addons/scripts/r.diversity", line 116, in
main
     resolution = checkValues(res)
   File "/home/veroandreo/.grass7/addons/scripts/r.diversity", line 272, in
checkValues
     reso = range(reso[0], reso[1] + 1, 2)
TypeError: range() integer end argument expected, got float.
}}}

Is this an error or just that documentation is wrong or outdated?

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

#3058: unexpected behavior/error message in r.diversity?
-------------------------+-------------------------
  Reporter: veroandreo | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Addons | Version: svn-trunk
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
-------------------------+-------------------------

Comment (by lucadelu):

Both error should be fixed in r68676.

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

#3058: unexpected behavior/error message in r.diversity?
-------------------------+-------------------------
  Reporter: veroandreo | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.2.0
Component: Addons | Version: svn-trunk
Resolution: fixed | Keywords:
       CPU: x86-64 | Platform: Linux
-------------------------+-------------------------
Changes (by veroandreo):

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

Comment:

Both errors dissapeared. Works as expected now.

Thanks :slight_smile:

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