def __init__(self, tool, source_nodes, sink_node, alignment_node, plates):
        """
        Initialise this factor

        :param tool: The tool
        :param source_nodes: The source nodes
        :param sink_node: The sink node
        :param alignment_node: The node (possibly a clock node) that the output node will have data aligned to
        :param plates: The plates over which this factor is defined
        :type tool: Tool
        :type sink_node: Node
        :type alignment_node: Node | None
        :type plates: list[Plate] | tuple[Plate]
        """
        if not isinstance(tool, BaseTool):
            raise ValueError("Expected tool, got {}".format(type(tool)))

        if isinstance(tool, MultiOutputTool):
            raise IncompatibleToolError("Use MultiOutputFactor for MultiOutputTool")

        if isinstance(tool, PlateCreationTool):
            raise IncompatibleToolError("Use NodeCreationFactor for PlateCreationTool")

        super(Factor, self).__init__(tool)

        if source_nodes:
            for source in source_nodes:
                if not isinstance(source, Node):
                    raise ValueError("Expected node, got {}".format(type(source)))
                source.is_leaf = False
        self.sources = source_nodes if source_nodes else []
        if not isinstance(sink_node, Node):
            raise ValueError("Expected node, got {}".format(type(sink_node)))
        self.sink = sink_node
        sink_node._factor = self
        
        self.plates = plates
        
        if alignment_node and not isinstance(alignment_node, Node):
            raise ValueError("Expected node, got {}".format(type(alignment_node)))
        
        if alignment_node and alignment_node.plates:
            # TODO: Need to implement alignment nodes that live inside plates
            raise NotImplementedError("Currently only alignment nodes outside of plates are supported")
        
        self.alignment_node = alignment_node
def __init__ ( self , tool , source_nodes , sink_node , alignment_node , plates ) : if not isinstance ( tool , BaseTool ) : raise ValueError ( "Expected tool, got {}" . format ( type ( tool ) ) ) if isinstance ( tool , MultiOutputTool ) : raise IncompatibleToolError ( "Use MultiOutputFactor for MultiOutputTool" ) if isinstance ( tool , PlateCreationTool ) : raise IncompatibleToolError ( "Use NodeCreationFactor for PlateCreationTool" ) super ( Factor , self ) . __init__ ( tool ) if source_nodes : for source in source_nodes : if not isinstance ( source , Node ) : raise ValueError ( "Expected node, got {}" . format ( type ( source ) ) ) source . is_leaf = False self . sources = source_nodes if source_nodes else [ ] if not isinstance ( sink_node , Node ) : raise ValueError ( "Expected node, got {}" . format ( type ( sink_node ) ) ) self . sink = sink_node sink_node . _factor = self self . plates = plates if alignment_node and not isinstance ( alignment_node , Node ) : raise ValueError ( "Expected node, got {}" . format ( type ( alignment_node ) ) ) if alignment_node and alignment_node . plates : raise NotImplementedError ( "Currently only alignment nodes outside of plates are supported" ) self . alignment_node = alignment_node
Initialise this factor

        :param tool: The tool
        :param source_nodes: The source nodes
        :param sink_node: The sink node
        :param alignment_node: The node (possibly a clock node) that the output node will have data aligned to
        :param plates: The plates over which this factor is defined
        :type tool: Tool
        :type sink_node: Node
        :type alignment_node: Node | None
        :type plates: list[Plate] | tuple[Plate]