Describes an abstract model component.
The described model component should maps on to a structure of the param command line parser. Non-abstract subclasses should override several class variables, in particular PRM_ARRAY, the name of the array in the .prm file (e.g. 'stimulus' when the structure is like '-stim[0].name'), and PRM_LENGTH, the variable specifiying the length of the structure array (e.g. 'num_stim' for the simuli.)
As the intended root base class for all model components, this class is responsible for checking that no unrecognised fields were passed (done in __init__
) and generating the actual option list (in opts_formatted
).
Additional types of options can be added in base classes by extending the output of the opts
method, which is used by opts_formatted
when generating the option list. This is readily achieved in subclasses and mixins (in the case of multiple inheritance) by first looping over the super class's opts
output and then appending on to it the additional opts to be returned.