[GRASS-dev] g.parser and "#% type: double"
nik at nikosalexandris.net
Sat Nov 15 08:34:02 PST 2014
>> Given the following..
>> #% key: sea
>> #% type: double
Markus Neteler wrote:
> ... this defines what type is *accepted* as input.
>> #% description: Aquisition's Sun Elevation Angle
>> #% options: 0.0 - 90.0
>> #% guisection: Metadata
>> #% required: yes
>> import grass.script as grass
>> def main()
>> sea = options['sea']
>> if __name__ == "__main__":
>> options, flags = grass.parser()
>> Isn't supposed that sea is returned as a float?
> No, above is the definition for the accepted input type.
>> Is it really necessary to do
>> sea = float(options['sea'])
Is it too much work to make this automatic? I am trying to think why
should a user/scripter want something else than the type that the
parameter (in CLI or wx-GUI) requests?
More information about the grass-dev