interfaces.utility.wrappers

Function

Link to code

Runs arbitrary function as an interface

Examples

>>> func = 'def func(arg1, arg2=5): return arg1 + arg2'
>>> fi = Function(input_names=['arg1', 'arg2'], output_names=['out'])
>>> fi.inputs.function_str = func
>>> res = fi.run(arg1=1)
>>> res.outputs.out
~

Inputs:

[Mandatory]
function_str: (a unicode string)
        code for function

Outputs:

None