Node#

Node module#

class mmodel.node.Node(name, func, inputs=None, output=None, modifiers=None, **kwargs)[source]#

Bases: object

A node class that formats node function and metadata.

convert_func(func, inputs)[source]#

Convert function to a node function.

For numpy.ufunc and builtin type, the “inputs” argument is required.

If inputs are provided, the signature is changed based on the inputs and keyword-only. If the “inputs” is None, the signature is changed keyword only, and the default values are removed.

The keyword-only design reduced binding overhead during the function calls, and allow more consistency between node, modifier, and model.

edit(**kwargs)[source]#

Edit node. A new node object is created.

property inputs#

Return a copy of inputs.

property modifiers#

Return a copy of modifiers.

property signature#

Return signature.