[GRASS-dev] [GRASS GIS] #3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters

#3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters
-----------------------+-------------------------
Reporter: rorschach | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.5
Component: Default | Version: 7.0.4
Keywords: | CPU: x86-64
Platform: Linux |
-----------------------+-------------------------
A very minor issue. GRASS 7 changed the names of cellinp and cellout
parameters of the v.vol.rst module to cross_input and cross_output
respectively but when the module issues a warning it still says:

WARNING: Unable to create '''cellout''' raster map without '''cellinp'''
(''emphasis supplied'')

This may be minor but I think it throws off a user because there is no
cellout or cellinp option anymore in GRASS 7.

I haven't checked if the same goes for other WARNING/ERROR messages for
other modules. The main source code probably needs a little proofreading
to avoid simple ''defects'' like this. I would volunteer but I don't have
access to the main svn (yet).

Thank you.

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

#3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters
------------------------+-------------------------
  Reporter: rorschach | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.5
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
------------------------+-------------------------

Comment (by hellik):

Replying to [ticket:3100 rorschach]:
>
> I haven't checked if the same goes for other WARNING/ERROR messages for
other modules. The main source code probably needs a little proofreading
to avoid simple ''defects'' like this. I would volunteer but I don't have
access to the main svn (yet).

you can have a look online at the code of trunk and all the branches here:

https://trac.osgeo.org/grass/browser/grass

or do a svn checkout, see
[https://trac.osgeo.org/grass/wiki/DownloadSource#SubversionGRASSmainsourcecoderepository
svn checkout]

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

#3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters
------------------------+-------------------------
  Reporter: rorschach | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.5
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
------------------------+-------------------------

Comment (by rorschach):

Checked the source, found the problem on line '''640''' of the module's
main.c file which reads:

{{{
G_warning(_("Unable to create cellout raster map without cellinp"));
}}}

Can someone change this to:
{{{
G_warning(_("Unable to create cross_output raster map without
cross_input"));
}}}

for consistency?

Thanks.

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

#3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters
------------------------+-------------------------
  Reporter: rorschach | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.5
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
------------------------+-------------------------

Comment (by wenzeslaus):

Thanks. A better fix is using the names as defined in the `Option`
structure by attribute `key` (example from
[source:grass/trunk/raster/r.slope.aspect/main.c#L315 r.slope.aspect]:

{{{
#!c
G_fatal_error(_("%s=%s - must be a positive number"), parm.zfactor->key,
parm.zfactor->answer);
}}}

Can you please also check if there are other places like this, e.g. using
`grep cell` and create a patch using `svn diff`?

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

#3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters
------------------------+-------------------------
  Reporter: rorschach | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.5
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
------------------------+-------------------------

Comment (by neteler):

Attempt done in r69439: if ok to be backported

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

#3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters
------------------------+-------------------------
  Reporter: rorschach | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
------------------------+-------------------------

Comment (by mlennert):

Replying to [comment:4 neteler]:
> Attempt done in r69439: if ok to be backported

Actually, the test tests for the existance of both maps:

{{{
if ((cellinp != NULL) && (cellout != NULL)) {
}}}

so the message will pop up if either of them is missing or if both are
missing, so this is not very helpful. Especially when you don't give
either of them, you get:

{{{
ATTENTION: Unable to create <(null)> raster map without cross_input raster
            map being specified
}}}

I think this should be handled by parameter dependency rules for the
parser, and not by the code. Something like:

{{{
G_option_collective(parm.cellinp, parm.cellout)
}}}

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

#3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters
------------------------+-------------------------
  Reporter: rorschach | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
------------------------+-------------------------
Changes (by mlennert):

* Attachment "v_vol_rst_exclusive_options.diff" added.

diff to implement options dependency checks through parser

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

#3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters
------------------------+-------------------------
  Reporter: rorschach | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
------------------------+-------------------------

Comment (by mlennert):

Replying to [comment:6 mlennert]:
> Replying to [comment:4 neteler]:
> > Attempt done in r69439: if ok to be backported
>
> Actually, the test tests for the existance of both maps:
>
> {{{
> if ((cellinp != NULL) && (cellout != NULL)) {
> }}}
>
> so the message will pop up if either of them is missing or if both are
missing, so this is not very helpful. Especially when you don't give
either of them, you get:
>
>
> {{{
> ATTENTION: Unable to create <(null)> raster map without cross_input
raster
> map being specified
> }}}
>
> I think this should be handled by parameter dependency rules for the
parser, and not by the code. Something like:
>
> {{{
> G_option_collective(parm.cellinp, parm.cellout)
> }}}
>

Try the attached patch which implements the above and other checks that
were done in the code.

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

#3100: v.vol.rst WARNING in GRASS 7 still says cellout and cellinp rasters
------------------------+-------------------------
  Reporter: rorschach | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.7
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
------------------------+-------------------------

Comment (by martinl):

Still relevant?

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