[GRASS-dev] verbose in grass.array .write() function

Hi,

in GRASS 6.5 the python array.write() function in
http://svn.osgeo.org/grass/grass/branches/develbranch_6/lib/python/array.py

has set verbose=TRUE. Is there any reason for that?

It seems when using the .write() function in a personal

script the verbose-level is not parsed to that underlying function. So

even when in the script the quiet-flag is set, an output (progress, percentage) is still printed. So maybe some lines like in
http://svn.osgeo.org/grass/grass/branches/develbranch_6/lib/python/raster.py

could be added for this function as well:
if quiet:
env[‘GRASS_VERBOSE’] = ‘0’
if verbose:
env[‘GRASS_VERBOSE’] = ‘3’
if overwrite:
env[‘GRASS_OVERWRITE’] = ‘1’

Does that make sense?

Best

Johannes

Johannes Radinger wrote:

in GRASS 6.5 the python array.write() function in
http://svn.osgeo.org/grass/grass/branches/develbranch_6/lib/python/array.py
has set verbose=TRUE. Is there any reason for that?

It was probably added during development and not reverted.

It seems when using the .write() function in a personal
script the verbose-level is not parsed to that underlying function. So
even when in the script the quiet-flag is set, an output (progress,
percentage) is still printed. So maybe some lines like in
http://svn.osgeo.org/grass/grass/branches/develbranch_6/lib/python/raster.py
could be added for this function as well:
    if quiet:
        env['GRASS_VERBOSE'] = '0'
    if verbose:
        env['GRASS_VERBOSE'] = '3'
    if overwrite:
        env['GRASS_OVERWRITE'] = '1'

That's not necessary; it should either pass quiet=True or pass neither
quiet= nor verbose=, and allow the script's verbosity setting to be
inherited.

--
Glynn Clements <glynn@gclements.plus.com>

So actually verbose=True should then be removed from the function
so that it behaves like other GRASS modules and the verbosity level
setting is inherited from the script in which .write() is used?
Or is there any particular reason why verbosity level is 3 be default?
If not I could file a report for improvement.

/Johannes

···

On Sat, Apr 6, 2013 at 10:32 AM, Glynn Clements <glynn@gclements.plus.com> wrote:

Johannes Radinger wrote:

in GRASS 6.5 the python array.write() function in
http://svn.osgeo.org/grass/grass/branches/develbranch_6/lib/python/array.py
has set verbose=TRUE. Is there any reason for that?

It was probably added during development and not reverted.

It seems when using the .write() function in a personal
script the verbose-level is not parsed to that underlying function. So
even when in the script the quiet-flag is set, an output (progress,
percentage) is still printed. So maybe some lines like in
http://svn.osgeo.org/grass/grass/branches/develbranch_6/lib/python/raster.py
could be added for this function as well:
if quiet:
env[‘GRASS_VERBOSE’] = ‘0’
if verbose:
env[‘GRASS_VERBOSE’] = ‘3’
if overwrite:
env[‘GRASS_OVERWRITE’] = ‘1’

That’s not necessary; it should either pass quiet=True or pass neither
quiet= nor verbose=, and allow the script’s verbosity setting to be
inherited.


Glynn Clements <glynn@gclements.plus.com>

Johannes Radinger wrote:
> in GRASS 6.5 the python array.write() function in
> http://svn.osgeo.org/grass/grass/branches/develbranch_6/lib/python/array.py
> has set verbose=TRUE. Is there any reason for that?

I guess you are talking about this:
  https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/script/array.py#L238

Glynn:

It was probably added during development and not reverted.

just to note that verbose=True argument for r.in.bin is present in all
branches, and has been there for some years (for better or worse).

Hamish

Johannes Radinger wrote:

So actually verbose=True should then be removed from the function
so that it behaves like other GRASS modules and the verbosity level
setting is inherited from the script in which .write() is used?

I think so.

--
Glynn Clements <glynn@gclements.plus.com>

Hamish wrote:

Glynn:
> It was probably added during development and not reverted.

just to note that verbose=True argument for r.in.bin is present in all
branches, and has been there for some years (for better or worse).

Right; by "during development", I mean "before the first version was
committed to SVN".

--
Glynn Clements <glynn@gclements.plus.com>