Skip to content

Commit

Permalink
Merge branch 'master' into structural-shifts
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenbugs committed Mar 9, 2023
2 parents 00c842b + e250ba3 commit 2f9677c
Show file tree
Hide file tree
Showing 37 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion tests/go/test_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dgl
import pytest
import torch
from test_utils.graph_cases import get_cases
from pytests_utils.graph_cases import get_cases
from dglgo.model import *


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/python/common/dataloading/test_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
negative_sampler,
NeighborSampler,
)
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


def create_test_graph(idtype):
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/function/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np
import scipy.sparse as ssp
from dgl import DGLGraph
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype

D = 5
reduce_msg_shapes = set()
Expand Down
4 changes: 2 additions & 2 deletions tests/python/common/ops/test_edge_softmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
import networkx as nx
import numpy as np
import pytest
import pytests_utils
import scipy.sparse as ssp
import test_utils
from dgl import DGLError
from dgl.ops import edge_softmax
from pytests_utils import get_cases, parametrize_idtype
from scipy.sparse import rand
from test_utils import get_cases, parametrize_idtype

edge_softmax_shapes = [(1,), (1, 3), (3, 4, 5)]
rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean}
Expand Down
4 changes: 2 additions & 2 deletions tests/python/common/ops/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import pytest
import torch
from dgl.ops import gather_mm, gsddmm, gspmm, segment_reduce
from test_utils import parametrize_idtype
from test_utils.graph_cases import get_cases
from pytests_utils import parametrize_idtype
from pytests_utils.graph_cases import get_cases

random.seed(42)
np.random.seed(42)
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_batch-graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import dgl
import numpy as np
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


def tree1(idtype):
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_batch-heterograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import dgl
import pytest
from dgl.base import ALL
from test_utils import check_graph_equal, get_cases, parametrize_idtype
from pytests_utils import check_graph_equal, get_cases, parametrize_idtype


def check_equivalence_between_heterographs(
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import dgl.ndarray as nd
import numpy as np
from dgl.frame import Column
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


def test_column_subcolumn():
Expand Down
4 changes: 2 additions & 2 deletions tests/python/common/test_heterograph-apply-edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import networkx as nx
import numpy as np
import pytest
import pytests_utils
import scipy.sparse as ssp
import test_utils
from dgl import DGLError
from pytests_utils import get_cases, parametrize_idtype
from scipy.sparse import rand
from test_utils import get_cases, parametrize_idtype

rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean}
fill_value = {"sum": 0, "max": float("-inf")}
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_heterograph-kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import networkx as nx
import numpy as np
import pytest
from test_utils import get_cases, parametrize_idtype
from pytests_utils import get_cases, parametrize_idtype


def udf_copy_src(edges):
Expand Down
8 changes: 4 additions & 4 deletions tests/python/common/test_heterograph-pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import dgl.function as fn
import networkx as nx
import pytest
import pytests_utils
import scipy.sparse as ssp
import test_utils
from dgl.graph_index import create_graph_index
from dgl.utils import toindex
from test_utils import get_cases, parametrize_idtype
from pytests_utils import get_cases, parametrize_idtype
from utils import assert_is_identical, assert_is_identical_hetero


Expand Down Expand Up @@ -110,7 +110,7 @@ def _global_message_func(nodes):
def test_pickling_graph(g, idtype):
g = g.astype(idtype)
new_g = _reconstruct_pickle(g)
test_utils.check_graph_equal(g, new_g, check_feature=True)
pytests_utils.check_graph_equal(g, new_g, check_feature=True)


@unittest.skipIf(F._default_context_str == "gpu", reason="GPU not implemented")
Expand Down Expand Up @@ -142,7 +142,7 @@ def test_pickling_batched_heterograph():

bg = dgl.batch([g, g2])
new_bg = _reconstruct_pickle(bg)
test_utils.check_graph_equal(bg, new_bg)
pytests_utils.check_graph_equal(bg, new_bg)


@unittest.skipIf(
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_heterograph-remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import dgl
import numpy as np
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


@parametrize_idtype
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_heterograph-shared-memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import scipy.sparse as ssp
from dgl.graph_index import create_graph_index
from dgl.utils import toindex
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


def create_test_graph(idtype):
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_heterograph-specialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import dgl.function as fn
import numpy as np
import scipy.sparse as sp
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype

D = 5

Expand Down
4 changes: 2 additions & 2 deletions tests/python/common/test_heterograph-update-all.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import networkx as nx
import numpy as np
import pytest
import pytests_utils
import scipy.sparse as ssp
import test_utils
from dgl import DGLError
from pytests_utils import get_cases, parametrize_idtype
from scipy.sparse import rand
from test_utils import get_cases, parametrize_idtype

rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean}
feat_size = 2
Expand Down
6 changes: 3 additions & 3 deletions tests/python/common/test_heterograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import networkx as nx
import numpy as np
import pytest
import pytests_utils
import scipy.sparse as ssp
import test_utils
from dgl import DGLError
from pytests_utils import get_cases, parametrize_idtype
from scipy.sparse import rand
from test_utils import get_cases, parametrize_idtype
from utils import assert_is_identical_hetero


Expand Down Expand Up @@ -2419,7 +2419,7 @@ def test_dtype_cast(idtype):
else:
g_cast = g.int()
assert g_cast.idtype == F.int32
test_utils.check_graph_equal(g, g_cast, check_idtype=False)
pytests_utils.check_graph_equal(g, g_cast, check_idtype=False)


def test_float_cast():
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_homophily.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import backend as F

import dgl
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


@unittest.skipIf(
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_merge.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import backend as F

import dgl
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


@parametrize_idtype
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from dgl.distributed import graph_partition_book as gpb
from dgl.partition import NDArrayPartition
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


@unittest.skipIf(
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_propagate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import dgl
import networkx as nx
import utils as U
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


def create_graph(idtype):
Expand Down
4 changes: 2 additions & 2 deletions tests/python/common/test_readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import networkx as nx
import numpy as np
import pytest
from test_utils import parametrize_idtype
from test_utils.graph_cases import get_cases
from pytests_utils import parametrize_idtype
from pytests_utils.graph_cases import get_cases


@parametrize_idtype
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_sparse_ops-csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np
import pytest
import scipy.sparse as ssp
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype

if F.backend_name == "pytorch":
import torch
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import pytest
import scipy.sparse as ssp
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype

D = 5

Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/test_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import networkx as nx
import numpy as np
import scipy.sparse as sp
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype

np.random.seed(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/transforms/test_functional-sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pytest
import scipy.sparse as ssp
from dgl import DGLError
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


def create_test_heterograph(num_nodes, num_adj, idtype):
Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/transforms/test_to_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import dgl
import dgl.partition
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


@parametrize_idtype
Expand Down
4 changes: 2 additions & 2 deletions tests/python/common/transforms/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import networkx as nx
import numpy as np
import pytest
from pytests_utils import parametrize_idtype
from pytests_utils.graph_cases import get_cases
from scipy import sparse as spsp
from test_utils import parametrize_idtype
from test_utils.graph_cases import get_cases

D = 5

Expand Down
2 changes: 1 addition & 1 deletion tests/python/common/utils/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import dgl
import numpy as np
from dgl.utils import Filter
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


def test_graph_filter():
Expand Down
4 changes: 2 additions & 2 deletions tests/python/mxnet/test_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import pytest
import scipy as sp
from mxnet import autograd, gluon, nd
from test_utils import parametrize_idtype
from test_utils.graph_cases import (
from pytests_utils import parametrize_idtype
from pytests_utils.graph_cases import (
get_cases,
random_bipartite,
random_dglgraph,
Expand Down
2 changes: 1 addition & 1 deletion tests/python/pytorch/dataloading/test_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pytest
import torch
import torch.distributed as dist
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype


@pytest.mark.parametrize("batch_size", [None, 16])
Expand Down
4 changes: 2 additions & 2 deletions tests/python/pytorch/geometry/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from dgl import DGLError
from dgl.base import DGLWarning
from dgl.geometry import farthest_point_sampler, neighbor_matching
from test_utils import parametrize_idtype
from test_utils.graph_cases import get_cases
from pytests_utils import parametrize_idtype
from pytests_utils.graph_cases import get_cases


def test_fps():
Expand Down
2 changes: 1 addition & 1 deletion tests/python/pytorch/mpops/test_edgewise.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
import pytest
import torch
from test_utils import parametrize_idtype
from pytests_utils import parametrize_idtype

random.seed(42)
np.random.seed(42)
Expand Down
4 changes: 2 additions & 2 deletions tests/python/pytorch/nn/test_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import scipy as sp
import torch
import torch as th
from test_utils import parametrize_idtype
from test_utils.graph_cases import (
from pytests_utils import parametrize_idtype
from pytests_utils.graph_cases import (
get_cases,
random_bipartite,
random_dglgraph,
Expand Down
6 changes: 3 additions & 3 deletions tests/python/tensorflow/test_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import pytest
import scipy as sp
import tensorflow as tf
from tensorflow.keras import layers
from test_utils import parametrize_idtype
from test_utils.graph_cases import (
from pytests_utils import parametrize_idtype
from pytests_utils.graph_cases import (
get_cases,
random_bipartite,
random_dglgraph,
random_graph,
)
from tensorflow.keras import layers


def _AXWb(A, X, W, b):
Expand Down

0 comments on commit 2f9677c

Please sign in to comment.