sampo.structurator.insert_wu#
Overview#
|
Inserts new node in the WorkGraph, based on given WorkUnit |
|
- |
|
- |
Functions#
- sampo.structurator.insert_wu.insert_work_unit(original_wg: sampo.schemas.graph.WorkGraph, inserted_wu: sampo.schemas.works.WorkUnit, parents_edges: list[GraphNode] or list[tuple[GraphNode, float, EdgeType]], children_edges: list[GraphNode] or list[tuple[GraphNode, float, EdgeType]], change_id: bool = True) sampo.schemas.graph.WorkGraph#
Inserts new node in the WorkGraph, based on given WorkUnit :param original_wg: WorkGraph into which we insert new node :param inserted_wu: WorkUnit on the basis of which we create new GraphNode :param parents_edges: nodes which are supposed to be the parents of new GraphNode :param children_edges: nodes which are supposed to be the children of new GraphNode :param change_id: do ids in the new graph need to be changed :return: new WorkGraph with inserted new node
- sampo.structurator.insert_wu._new_edges(copied_nodes: dict[str, sampo.schemas.graph.GraphNode], original_old_to_new_ids: dict[str, str], edges: list[tuple[sampo.schemas.graph.GraphNode, float, sampo.schemas.graph.EdgeType]]) list[tuple[sampo.schemas.graph.GraphNode, float, sampo.schemas.graph.EdgeType]]#
- sampo.structurator.insert_wu._reduce_to_tuple_type(edges: list[GraphNode] or list[tuple[GraphNode, float, EdgeType]]) list[tuple[sampo.schemas.graph.GraphNode, float, sampo.schemas.graph.EdgeType]]#