colour.utilities.ParallelForMultiprocess#

class colour.utilities.ParallelForMultiprocess(*args: Any, **kwargs: Any)[source]#

Bases: ControlFlowNode

Define a parallel for loop node that distributes operations across multiple processes.

Distribute iteration work by assigning each task one index and element output port value. Execute tasks using a multiprocessing.Pool instance, then collect, sort, and assign results to the results output port.

Upon completion, invoke the colour.utilities.ExecutionNode.process() method of the object connected to the execution_output output port.

Notes

  • The colour.utilities.ParallelForMultiprocess loop node currently invokes only the two aforementioned colour.utilities.ExecutionNode.process() methods. When a series of nodes connects to the loop_output or execution_output output ports, only the left-most node processes. To circumvent this limitation, use a colour.utilities.PortGraph class instance.

Return a new instance of the colour.utilities.TreeNode class.

Parameters:
  • args (Any) – Arguments.

  • kwargs (Any) – Keywords arguments.

__init__(*args: Any, **kwargs: Any) None[source]#
Parameters:
Return type:

None

process() None[source]#

Process the for loop node execution.

Return type:

None