geo3d.core.links ================ .. py:module:: geo3d.core.links Functions --------- .. autoapisummary:: geo3d.core.links.link geo3d.core.links.interlink geo3d.core.links.structure_parse Module Contents --------------- .. py:function:: link(A: Union[List[Any], str], B: Union[List[Any], str]) -> Dict[str, List[str]] Link element A to its following element B. A and B can be both lists or just single elements. A schema of a pipeline is defined as a list containing the elements to be linked and the way they are linked. Level 1 nested lists represent parallel elements while level 2 nested lists represent sequence elements. Having elements followed by each other, They must be linked, meaning that the input of the following element has to list the outputs behind it. 4 cases can be drawn: 1. Case 1 (line) pipeline: A -- B link("A", "B") = {"B": ["A"]} 2. Case 2 (diverge) B / pipeline: A - \ C link("A", ["B", "C"]) = {"B": ["A"], "C": ["A"]} 3. Case 3 (converge) A \ pipeline: - C / B link(["A", "B"], "C"]) = {"C": ["A", "B"]} 4. Case 4 (both directions) A C \ / pipeline: - / \ B D link(["A", "B"], ["C", "D"]) = {"C": ["A", "B"],"D": ["A", "B"]} Also, in the case of elements arranged in sequence, `link` must link only the output of the sequence to the following element and only the input of the sequence to the previous element. For example, if we consider the following schema: schema = [[A, [B, C]], D] the pipeline is as follows: A \ pipeline: - D / B - c link(schema) = {"D": ["A", "C"]} In the same way, the opposite direction gets handled as follows: schema = [[[A, B], C], D] B - C / pipeline: A - \ D link(schema) ={["D": ["A"], "B": ["A"]} The remaining links in a sequence element will be treated in the `interlink` function. :returns: A dictionary of links. :rtype: dict .. py:function:: interlink(A: List[str]) -> Dict[str, List[str]] Link together the elements of sequence of elements. :returns: A dictionary of links. :rtype: dict .. py:function:: structure_parse(pipeline: List[Union[List[str], str]]) -> Dict[str, List[str]] Parse the pipeline in a linking dictionary. Examples of pipelines can be found in the `link` function.