gigl.src.common.graph_builder.pyg_graph_builder#

Attributes#

Classes#

PygGraphBuilder

Abstract base class for generic types.

Module Contents#

class gigl.src.common.graph_builder.pyg_graph_builder.PygGraphBuilder[source]#

Bases: gigl.src.common.graph_builder.abstract_graph_builder.GraphBuilder[gigl.src.common.graph_builder.pyg_graph_data.PygGraphData]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
build()[source]#

Builds the actual TGraph data object and returns it with all of the registered nodes and edges. Will also reset i.e. unregister all existed nodes and edges such that GraphBuilder can be used again to build a new graph

Returns:

The data object with all of the nodes/edges

Return type:

TGraph

gigl.src.common.graph_builder.pyg_graph_builder.logger[source]#