Example #1
0
def test_load_invalid_path():
    with pytest.raises(TsubaError):
        PropertyGraph("non-existent")
Example #2
0
def check_schema(property_graph: PropertyGraph, property_name):
    node_schema: Schema = property_graph.node_schema()
    num_node_properties = len(node_schema)
    new_property_id = num_node_properties - 1
    assert node_schema.names[new_property_id] == property_name
Example #3
0
 def load_graph(graph_path):
     print(f"Running {args.application} on graph: {graph_path}")
     with time_block("read propertyGraph"):
         graph = PropertyGraph(graph_path)
     print(f"#Nodes: {len(graph)}, #Edges: {graph.num_edges()}")
     return graph
Example #4
0
def initialize_cc_push_operator(graph: PropertyGraph, comp_current: np.ndarray,
                                comp_old: np.ndarray, nid):
    # Initialize each node in its own component
    comp_current[nid] = nid
    comp_old[nid] = graph.num_nodes()