finesse.element module
- class finesse.element.ModelElement(*args, **kwargs)[source]
Bases:
objectBase for any object which can be an element of a
Model.When added to a model it will attempt to call the method _on_add so that the element can do some initialisation if required.
Parameters
- namestr
Name of newly created model element.
- property default_parameter_name[source]
The default parameter to assume when the component is directly referenced.
This is used for example in kat script when the component is directly referenced in an expression, instead of the model parameter, e.g. ‘l1’ instead of ‘l1.P.’
Returns
- str
The name of the default model parameter.
- None
If there is no default.
- info(eval_refs=False)[source]
Element information.
Parameters
- eval_refsbool
Whether to evaluate symbolic references to their numerical values. Defaults to False.
Returns
- str
The formatted info.
- info_parameter_table()[source]
Info parameter table.
This provides a table with useful fields in addition to those contained in
parameter_table().Returns
- str
The formatted extra info table.
- None
If there are no info parameters.
- parameter_table(eval_refs=False, return_str=False)[source]
Model parameter table.
Parameters
- eval_refsbool
Whether to evaluate symbolic references to their numerical values. Does not have effect when return_str is False. Defaults to False.
- return_strbool
Return str representation instead of
finesse.utilities.tables.TableNecessary when setting eval_refs to True. Defaults to False.
Returns
finesse.utilities.tables.TableThe formatted parameter info table.
- str
String representation of the table, if ‘return_str’ is True
- None
If there are no parameters.
- property ref[source]
Reference to the default model parameter, if set.
Returns
ParameterRefReference to the default model parameter, if set.
Raises
- ValueError
If there is no default model parameter set for this element.