graphscope.framework.dag_utils.report_graph

graphscope.framework.dag_utils.report_graph(graph, report_type, node=None, edge=None, fid=None, lid=None, key=None, label_id=None, gid=None)[source]

Create report operation for nx graph.

This operation is used to simulate networkx graph reporting methods with variaty report type and corresponding config parameters.

Parameters:
  • graph (nx.Graph) – A nx graph.

  • report_type

    report type, can be type_pb2.(NODE_NUM,

    EDGE_NUM, HAS_NODE, HAS_EDGE, NODE_DATA, EDGE_DATA, NEIGHBORS_BY_NODE, SUCCS_BY_NODE, PREDS_BY_NODE, NEIGHBORS_BY_LOC, SUCCS_BY_LOC, PREDS_BY_LOC, DEG_BY_NODE, IN_DEG_BY_NODE, OUT_DEG_BY_NODE, DEG_BY_LOC, IN_DEG_BY_LOC, OUT_DEG_BY_LOC, NODES_BY_LOC)

  • node (str) – node id, used as node id with ‘NODE’ report types. (optional)

  • edge (str) – an edge with ‘EDGE’ report types. (optional)

  • fid (int) – fragment id, with ‘LOC’ report types. (optional)

  • lid (int) – local id of node in grape_engine, with ‘LOC; report types. (optional)

  • key (str) – edge key for MultiGraph or MultiDiGraph, with ‘EDGE’ report types. (optional)

Returns:

An op to do reporting job.