carputils
Doxygen code documentation for the python framework controlling openCARP
Public Member Functions | Static Public Attributes | List of all members
carputils.model.general.AbstractModelComponent Class Reference

Describes an abstract model component. More...

Inheritance diagram for carputils.model.general.AbstractModelComponent:
carputils.model.conductivity.ConductivityRegion carputils.model.general.AbstractIonicModel carputils.model.general.AbstractMechanicsMaterial carputils.model.stimulus.Stimulus carputils.model.general.ExternalIonicModel

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 = []
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def carputils.model.general.AbstractModelComponent.__init__ (   self,
  fields 
)

Member Function Documentation

◆ opts()

def carputils.model.general.AbstractModelComponent.opts (   self)

Generator that yields field name - value pairs for the command line.

◆ opts_formatted()

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

Member Data Documentation

◆ FIELDS

list carputils.model.general.AbstractModelComponent.FIELDS = []
static

◆ PRM_ARRAY

carputils.model.general.AbstractModelComponent.PRM_ARRAY = None
static

◆ PRM_LENGTH

carputils.model.general.AbstractModelComponent.PRM_LENGTH = None
static

The documentation for this class was generated from the following file: