[GRASS-user] Looping r.sun.hourly with Python script fails

Pietro peter.zamb at gmail.com
Wed Apr 1 05:39:42 PDT 2015


Hi Anna,

On Wed, Apr 1, 2015 at 1:49 PM, Anna Petrášová <kratochanna at gmail.com> wrote:
>
>
> On Wed, Apr 1, 2015 at 6:46 AM, Pietro <peter.zamb at gmail.com> wrote:
>>
>> Dear Umberto,
>>
>> On Wed, Apr 1, 2015 at 11:46 AM, umberto.minora <umberto.minora at unimi.it>
>> wrote:
>> >   File "C:\OSGeo4W\apps\grass\grass-7.0.0\etc\python\grass\p
>> > ygrass\modules\interface\parameter.py", line 150, in
>> > __init__
>> >     self.values = [self.type(i) for i in diz['values']]
>> > ValueError: invalid literal for int() with base 10: '1-'
>>
>> The problem here is that the r.sun.hourly define the parmeter nprocs as:
>>
>> {{{
>> #%option
>> #% key: nprocs
>> #% type: integer
>> #% description: Number of r.sun processes to run in parallel
>> #% options: 1-
>> #% answer: 1
>> #%end
>> }}}
>>
>> To me this "#% options: 1-" is wrong, and it does not make to much
>> sense. I'm keen on removing this row.
>>
>> Vaclav and Anna, what is it your feeling?
>
>
> I think it makes sense, it means greater or equal to 1. It is supported by
> the parser, so you might find more of these cases in other modules.

The only cases available are in the grass-addons:

{{{
$ grep --color=auto --exclude-dir={.svn,.git,.OBJ,locale} -IrnE
"^#%\s+options: 1-$"

grass_addons/grass7/raster/r.lake.series/r.lake.series.py:95:#% options: 1-
grass_addons/grass7/raster/r.shaded.pca/r.shaded.pca.py:85:#% options: 1-
grass_addons/grass7/raster/r.sun.daily/r.sun.daily.py:129:#% options: 1-
grass_addons/grass7/raster/r.sun.hourly/r.sun.hourly.py:120:#% options: 1-
}}}

I fix this in r64969.

See you soon.

Pietro


More information about the grass-user mailing list