Open FatimaArshad-DS opened 2 years ago
Thanks for reporting this @FatimaArshad-DS. The error message is indeed obscure, but basically it comes down to the fact that the execution engine can't determine how to evaluate the expression exponential
. There is no other parameter/input port with that value. Did you mean to call it exp
, which is defined as a parameter?
Note when the execution engine gets a string expression it can't evaluate, it returns it as a string (as opposed to filling in the values for the parameters etc and evaluating it with Python, and returning a numerical value). This is the default fallback since sometimes parameters will need to be actual strings.
See also the comment here: https://github.com/ModECI/MDF/discussions/235 about using an expression like a + exp(b)
in the value of parameters.
I have written this piece of code:
This resulted in this error: Exception: Error! Could not evaluate expression [exponential] with params [period=3.14, level=1, rate=1, exp=1], returned [exponential] which is a <class 'str'>
Sometimes even adding some parentheses gives this error. There should be a mechanism to display what caused an error to aid in troubleshooting process.