sampo.structurator#

Submodules#

Overview#

Function#

graph_restructuring(wg, use_lag_edge_optimization)

Rebuilds all edges into Finish-Start and Inseparable-Finish-Start edges

graph_in_graph_insertion(master_wg, master_start, master_finish, slave_wg, change_id)

Inserts the slave WorkGraph into the master WorkGraph,

work_graph_ids_simplification(wg, id_offset, change_id)

Creates a new WorkGraph with simplified numeric ids (numeric ids are converted to a string)

Attributes#

STAGE_SEP

-

Functions#

sampo.structurator.graph_restructuring(wg: sampo.schemas.graph.WorkGraph, use_lag_edge_optimization: bool | None = False) sampo.schemas.graph.WorkGraph#

Rebuilds all edges into Finish-Start and Inseparable-Finish-Start edges with the corresponding rebuilding of the nodes and returns new work graph

Parameters:
  • wg – WorkGraph - The graph to be converted

  • use_lag_edge_optimization – bool - if true - considers lags amount in edges, otherwise considers lags equal to zero and LagFinishStart edges as FinishStart edges

Returns:

new_work_graph: WorkGraph - restructured graph

sampo.structurator.graph_in_graph_insertion(master_wg: sampo.schemas.graph.WorkGraph, master_start: sampo.schemas.graph.GraphNode, master_finish: sampo.schemas.graph.GraphNode, slave_wg: sampo.schemas.graph.WorkGraph, change_id: bool = True) sampo.schemas.graph.WorkGraph#

Inserts the slave WorkGraph into the master WorkGraph, while the starting vertex slave_wg becomes the specified master_start, and the finishing vertex is correspondingly master_finish :param master_wg: the WorkGraph into which the insertion is performed :param master_start: GraphNode which will become the parent for the entire slave_wg :param master_finish: GraphNode which will become a child for the whole slave_wg :param slave_wg: WorkGraph to be inserted into master_wg :param change_id: do ids in the new graph need to be changed :return: new union WorkGraph

sampo.structurator.work_graph_ids_simplification(wg: sampo.schemas.graph.WorkGraph, id_offset: int = 0, change_id: bool = True) sampo.schemas.graph.WorkGraph#

Creates a new WorkGraph with simplified numeric ids (numeric ids are converted to a string) :param wg: original WorkGraph :param id_offset: start for numbering new ids :param change_id: Do IDs in the new graph need to be changed :return: new WorkGraph with numeric ids

Attributes#

sampo.structurator.STAGE_SEP = '_stage_'#