def graphscope_session(): graphscope.set_option(show_log=True) graphscope.set_option(initializing_interactive_engine=False) sess = graphscope.session(run_on_local=True, num_workers=1) sess.as_default() yield sess sess.close()
def graphscope_session(): graphscope.set_option(show_log=True) graphscope.set_option(initializing_interactive_engine=False) if os.environ.get("DEPLOYMENT", None) == "standalone": sess = graphscope.session(cluster_type="hosts", num_workers=1) else: sess = graphscope.session(cluster_type="hosts") yield sess sess.close()
def p2p_property_graph(num_workers, directed=True): data_dir = os.path.expandvars("${GS_TEST_DIR}/property") graphscope.set_option(show_log=True) graphscope.set_option(initializing_interactive_engine=False) sess = graphscope.session(num_workers=num_workers, run_on_local=True) graph = graphscope.Graph(sess, directed=directed) graph = graph.add_vertices("{}/p2p-31_property_v_0".format(data_dir), "person") graph = graph.add_edges("{}/p2p-31_property_e_0".format(data_dir), "knows") return sess, graph
def p2p_property_graph(num_workers, directed=True): data_dir = os.path.expandvars("${GS_TEST_DIR}/property") graphscope.set_option(show_log=True) sess = graphscope.session(num_workers=num_workers, run_on_local=True) g = sess.load_from( edges={ "knows": ( Loader("{}/p2p-31_property_e_0".format(data_dir), header_row=True), ["src_label_id", "dst_label_id", "dist"], ("src_id", "person"), ("dst_id", "person"), ), }, vertices={ "person": Loader("{}/p2p-31_property_v_0".format(data_dir), header_row=True), }, directed=directed, ) return sess, g
def setUpModule(): graphscope.set_option(show_log=True) graphscope.set_option(initializing_interactive_engine=False)
# import importlib import logging import os import random import string import sys import time import numpy as np import pytest import graphscope graphscope.set_option(show_log=True) from graphscope.dataset import load_p2p_network from graphscope.framework.app import AppAssets from graphscope.framework.app import AppDAGNode from graphscope.framework.errors import AnalyticalEngineInternalError from graphscope.framework.errors import InvalidArgumentError from graphscope.framework.loader import Loader test_repo_dir = os.path.expandvars("${GS_TEST_DIR}") prefix = os.path.join(test_repo_dir, "ogbn_mag_small") property_dir = os.path.join(test_repo_dir, "property") new_property_dir = os.path.join(test_repo_dir, "new_property", "v2_e2")
def setUpModule(): graphscope.set_option(show_log=True)