modeci_mdf.mdf.Function

class modeci_mdf.mdf.Function(id: str, function: Optional[str] = None, args: Optional[Dict[str, Any]] = None, value: Optional[Union[EvaluableExpression, List, Dict, ndarray, int, float, str]] = None, *, metadata: Optional[Dict[str, Any]] = None)[source]

Bases: MdfBase

A single value which is evaluated as a function of values on :class:`InputPort`(s) and other Functions

Variables:
  • id (str) – The unique (for this Node) id of the function, which will be used in other :class:`~Function`s and the :class:`~OutputPort`s for its value

  • function (Optional[str]) – Which of the in-build MDF functions (linear, etc.). See supported functions: https://mdf.readthedocs.io/en/latest/api/MDF_function_specifications.html

  • args (Optional[Dict[str, Any]]) – Dictionary of values for each of the arguments for the Function, e.g. if the in-built function is linear(slope),the args here could be {“slope”:3} or {“slope”:”input_port_0 + 2”}

  • value (Optional[Union[modelspec.base_types.EvaluableExpression, List, Dict, numpy.ndarray, int, float, str]]) – If the function is a value expression, this attribute will contain the expression and the function and args attributes will be None.

Method generated by attrs for class Function.

Methods