Electrostatics / APBS_Sphinx

APBS Rewrite
http://www.poissonboltzmann.org
1 stars 3 forks source link

Generalized plugin parameter definition and handling #41

Closed keith923 closed 8 years ago

keith923 commented 8 years ago

There is no consistency with how parameters are defined for plugins. Different plugins use positional parameters, others use keywords, and all are defined and handled in the plugin class. None currently have any sort of help mechanism available. Finally, for some plugins the parameter lists may be quite numerous.

I propose that each plugin provide a JSON specification of the allowable input parameters. This will be used in the plugin base class to validate plugin arguments, and set them as class member variables in the plugin instance.

keith923 commented 8 years ago

The initial go for this one is committed. A full specification is coming, and will be published on the wiki. In brief, a schema for allowed options, and ways to combine options is defined. There is provision for descriptions (for an eventual UI) as well as user data. An option validator ensures that runtime options are adhering to the schema in both type, as well as required options, mutually exclusive options, etc.

Plugins may use the schema to specify allowed options, and the validator will ensure that a correct set of options is supplied.