HxmFunction Class

class hexaly.modeler.HxmFunction

A function can be either a user-defined function or a built-in function. It is possible to create external modeler function from the modeler API and call them in the modeler. See HexalyModeler.create_function() for more information on how to create external functions.

Since:

10.0

Summary

Attributes

name

Returns the name of the function.

Methods

get_name

Returns the name of the function.

Special methods

__call__

Calls the function with the provided arguments and returns the result.

Instance methods

HxmFunction.get_name()

Returns the name of the function. The name of the function does not necessarily reflect the name of the variable(s) to which the function is associated. The name is mainly used to identify the function in stack traces when exceptions occur.

Returns:

The name of the function.

Return type:

str

Instance attributes

HxmFunction.name

Returns the name of the function. This is a shortcut for HxmFunction.get_name().

Special operators and methods

HxmFunction.__call__(\*args)

Calls the function with the provided arguments and returns the result. The arguments must be of the following types:

Parameters:

args – List of arguments passed to the function.

Returns:

Return value of the call.

Return type:

one of the supported type among NoneType (nil in Hexaly Modeler), int, float, bool, str, HxExpression, HxmFunction, HxmModule, HxmMap