|
carputils
Doxygen code documentation for the python framework controlling openCARP
|
Describes an abstract model component. More...
Public Member Functions | |
| def | __init__ (self, **fields) |
| def | opts (self) |
| Generator that yields field name - value pairs for the command line. More... | |
| def | opts_formatted (self, index) |
| Return the command line options for this model component. More... | |
Static Public Attributes | |
| PRM_ARRAY = None | |
| PRM_LENGTH = None | |
| list | FIELDS = [] |
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.
| def carputils.model.general.AbstractModelComponent.__init__ | ( | self, | |
| ** | fields | ||
| ) |
| def carputils.model.general.AbstractModelComponent.opts | ( | self | ) |
Generator that yields field name - value pairs for the command line.
Reimplemented in carputils.model.general.AbstractIonicModel, carputils.model.conductivity.ConductivityRegionEMI, and carputils.model.conductivity.ConductivityRegion.
| def carputils.model.general.AbstractModelComponent.opts_formatted | ( | self, | |
| index | |||
| ) |
Return the command line options for this model component.
Parameters ----------
index int The array index to use in generating the option list
Reimplemented in carputils.model.stimulus.Stimulus, and carputils.model.general.AbstractIonicModel.
|
static |
|
static |
|
static |