koi_net.infra.build_artifact

Classes

BuildArtifact(assembler)

class koi_net.infra.build_artifact.BuildArtifact(assembler)[source]

Bases: object

Parameters:

assembler (Assembler)

assembler: Assembler
build()[source]
build_init_graph()[source]

Builds dependency graph and component type map.

Graph representation is an adjacency list: the key is a component name, and the value is a tuple containing names of the depedencies.

build_start_graph()[source]
build_stop_graph()[source]
build_stop_order(start_order)[source]

Builds component stop order.

Reverse of start order, only including components with a stop method. NOTE: Components defining a stop method MUST also define a start method.

Return type:

list[str]

Parameters:

start_order (list[str])

collect_components()[source]

Collects components from class definition.

comp_dict: dict[str, Any]
comp_types: dict[str, CompType]
init_graph: dict[str, set[str]]
init_order: list[str]
static reverse_adj_list(adj)[source]
Parameters:

adj (dict[str, set[str]])

start_graph: dict[str, set[str]]
start_order: list[str]
stop_graph: dict[str, set[str]]
stop_order: list[str]
static topo_sort(adj)[source]

Topological sort of direct graph using Kahn’s algorithm.

Parameters:

adj (dict[str, set[str]])

static visualize(adj)[source]

Creates representation of dependency graph in Graphviz DOT language.

Return type:

str

Parameters:

adj (dict[str, list[str]])