You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the Parser has generated a Builder with the following Dispatcher:
When compile the function, the Builder has generated a new Dispatcher with all pre-calculated outputs (see (1+2)).
>>> func = builder.compile()
>>> func.plot()
In this case the builder couldn't execute the MYFUNC, because it has has a variable as input. But if you execute the compiled function you will get the same error:
>>> func(1)
Traceback (most recent call last):
...
schedula.utils.exc.DispatcherError: ("Failed DISPATCHING '%s' due to:\n %r", 'MYFUNC', FunctionError('Function not implemented!',))
Error description
In the first case your function has not any variable, so the compile method executes the function MYFUNC raising the error.
While, in the second case, since the function has a variable as input, the compile method cannot execute the function. In any case, you will receive the same error in the first execution of the compiled function.
Detect not implemented functions
If you want to detect not implemented functions, you can do the following:
>>> [k for k, v in builder.dsp.function_nodes.items() if v['function'] is formulas.functions.not_implemented]
['MYFUNC']
Describe the bug
The following formula:
func = formulas.Parser().ast('=MYFUNC(1)')[1].compile()
raises DispatcherError: ("Failed DISPATCHING '%s' due to:\n %r", 'MYFUNC', FunctionError('Function not implemented!',))
but:
func = formulas.Parser().ast('=MYFUNC(a)')[1].compile()
does not. It looks like the parser should always be able to detect that the function "MYFUNC" does not exist.
This is using version 0.1.3
The text was updated successfully, but these errors were encountered: