[GRASS-dev] [GRASS GIS] #3788: Bug for flag `-n` in r.lake.series

#3788: Bug for flag `-n` in r.lake.series
------------------------------+-------------------------
Reporter: Nikos Alexandris | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: unspecified
Keywords: r.lake.series | CPU: Unspecified
Platform: Unspecified |
------------------------------+-------------------------
Panos (pmav99) spotted a bug in line https://trac.osgeo.org/grass/browser
/grass-addons/grass7/raster/r.lake.series/r.lake.series.py#L193: it will
never be True because line https://trac.osgeo.org/grass/browser/grass-
addons/grass7/raster/r.lake.series/r.lake.series.py#L188 redefines `flag`
to be an empty string.

ps- @Vaclav, I can fix this since I can commit to SVN.

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

#3788: Bug for flag `-n` in r.lake.series
-------------------------------+---------------------------
  Reporter: Nikos Alexandris | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Addons | Version: unspecified
Resolution: | Keywords: r.lake.series
       CPU: Unspecified | Platform: Unspecified
-------------------------------+---------------------------

Comment (by neteler):

Please fix it, Nikos, thanks

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

#3788: Bug for flag `-n` in r.lake.series
-------------------------------+---------------------------
  Reporter: Nikos Alexandris | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Addons | Version: unspecified
Resolution: fixed | Keywords: r.lake.series
       CPU: Unspecified | Platform: Unspecified
-------------------------------+---------------------------
Changes (by Nikos Alexandris):

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

Comment:

Fixed with revision 74324.

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

#3788: Bug for flag `-n` in r.lake.series
-------------------------------+---------------------------
  Reporter: Nikos Alexandris | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Addons | Version: unspecified
Resolution: fixed | Keywords: r.lake.series
       CPU: Unspecified | Platform: Unspecified
-------------------------------+---------------------------

Comment (by baharmon):

I am getting an error flag `-n` in r.lake.series when freshly installed.
Here is an example:

{{{
r.lake.series elevation=elev_lid792_1m@PERMANENT output=flood
start_water_level=105 end_water_level=116 water_level_step=1
coordinates=638899.501992,220010.458167
}}}

{{{
Traceback (most recent call last):
   File
"/home/baharmon/.grass7/addons/scripts/r.lake.series", line
225, in <module>
     sys.exit(main())
   File
"/home/baharmon/.grass7/addons/scripts/r.lake.series", line
193, in main
     flags += 'n'
TypeError: unsupported operand type(s) for +=: 'dict' and
'str'
}}}

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

#3788: Bug for flag `-n` in r.lake.series
-------------------------------+---------------------------
  Reporter: Nikos Alexandris | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Addons | Version: unspecified
Resolution: fixed | Keywords: r.lake.series
       CPU: Unspecified | Platform: Unspecified
-------------------------------+---------------------------

Comment (by Nikos Alexandris):

I admit, I had seen two other "weird" lines in the script:
{{{
if 'n' in flags:
     flags += 'n'
}}}

but due to work overload lately, I forgot to fix'em.
After https://trac.osgeo.org/grass/changeset/74431, the module works for
me, from inside the `nc_basic_spm_grass7` Location:
{{{
r.lake.series elevation=elevation_int output=r.lake.series.output
start_water_level=150 end_water_level=
156 water_level_step=1 coordinates=637500.000000,221750.000000 --o
}}}

produces the following valid raster maps
{{{
r.lake.series.output_150.0
r.lake.series.output_151.0
r.lake.series.output_152.0
r.lake.series.output_153.0
r.lake.series.output_154.0
r.lake.series.output_155.0
r.lake.series.output_156.0
}}}

Try again please.

ps1- It seems that `t.list strds` is broken here. Will verify.

ps2- This is why automatic tests are a necessity to run after each and
every commit.

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

#3788: Bug for flag `-n` in r.lake.series
-------------------------------+---------------------------
  Reporter: Nikos Alexandris | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Addons | Version: unspecified
Resolution: fixed | Keywords: r.lake.series
       CPU: Unspecified | Platform: Unspecified
-------------------------------+---------------------------

Comment (by Nikos Alexandris):

Actual fix committed in https://trac.osgeo.org/grass/changeset/74432.

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