modeci_mdf.mdf.Function

class modeci_mdf.mdf.Function(id: str, function: str | None = None, args: Dict[str, Any] | None = None, value: EvaluableExpression | List | Dict | ndarray | int | float | str | None = None, *, metadata: Dict[str, Any] | None = 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 (str | None) – Which of the in-build MDF functions (linear, etc.). See supported functions: https://mdf.readthedocs.io/en/latest/api/MDF_function_specifications.html

  • args (Dict[str, Any] | None) – 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 (modelspec.base_types.EvaluableExpression | List | Dict | numpy.ndarray | int | float | str | None) – 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