-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Here is a proposal for several elements of the upgrade proposal:
The default_options in the functions would be changed to a format which describes the options in detail. The concrete proposal is:
default_options = {'opt1': option description, 'opt2': option_description,...}
option_description is dict with following elements:
'Type': Some type. int, float, string, list, ....
'Value type': 'Discrete' : A list of allowed values
'Range': A two-element list with range limits. Can also be list of lists if multiple ranges
'Value': The values or value ranges
'Default': The default value
'Comment' : This could be used as tooltip in a GUI
The merge_options routine would check whether the value of an option is a dictionary. Of not it considers it as the default value as used now. If it is a dictionary it looks for a 'Default' key. If not found the dictionary is considered as the default value. If found the description is interpreted and other (keyword, config file) values are checked.
Each routine would have a default_options keyword argument which would return the default_options dictionary. This could be used by an automatic GUI generator to generate entry fields for the options, therefore it would be the first step towards a GUI. We could also define a default_arguments keyword which would return the same description (plus position or keyword) for function arguments.
Any comments/proposals?