-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pytest lhb * pytest修改 * update * update * update * update * update * update * update * update --------- Co-authored-by: gyzhou2000 <[email protected]> Co-authored-by: gyzhou2000 <[email protected]>
- Loading branch information
1 parent
e7c2901
commit 1a754c5
Showing
48 changed files
with
1,026 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from gammagl.data import Graph | ||
from gammagl.datasets.blogcatalog import BlogCatalog | ||
import tensorlayerx as tlx | ||
|
||
|
||
def test_blogcatalog(): | ||
return | ||
dataset = BlogCatalog(root='./temp') | ||
graph = dataset[0] | ||
assert isinstance(graph, Graph) | ||
assert graph.num_nodes == 5196 | ||
assert graph.num_edges == 343486 | ||
assert graph.num_features == 8189 | ||
assert dataset.num_classes == 6 | ||
assert tlx.reduce_sum(tlx.cast(graph.train_mask, dtype=tlx.int64)) == 2598 | ||
assert tlx.reduce_sum(tlx.cast(graph.val_mask, dtype=tlx.int64)) == 1299 | ||
assert tlx.reduce_sum(tlx.cast(graph.test_mask, dtype=tlx.int64)) == 1299 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from gammagl.datasets.dblp import DBLP | ||
|
||
|
||
def test_dblp(): | ||
return | ||
root = './temp' | ||
dataset = DBLP(root=root, force_reload=True) | ||
data = dataset[0] | ||
assert 'author' in data.node_types, "Node type 'author' not found in data." | ||
assert 'paper' in data.node_types, "Node type 'paper' not found in data." | ||
assert 'term' in data.node_types, "Node type 'term' not found in data." | ||
assert 'conference' in data.node_types, "Node type 'conference' not found in data." | ||
assert data['author'].x.shape == (4057, 334), f"Author features shape mismatch: {data['author'].x.shape}" | ||
assert data['paper'].x.shape == (14328, 4231), f"Paper features shape mismatch: {data['paper'].x.shape}" | ||
assert data['term'].x.shape == (7723, 50), f"Term features shape mismatch: {data['term'].x.shape}" | ||
assert data['conference'].num_nodes == 20, f"Conference node count mismatch: {data['conference'].num_nodes}" | ||
assert data['author'].y.shape[0] == 4057, f"Author labels shape mismatch: {data['author'].y.shape}" | ||
print("All tests passed!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import tensorlayerx as tlx | ||
from gammagl.datasets.ml import MLDataset # Replace with the correct module path | ||
|
||
|
||
def test_mldataset(): | ||
if tlx.BACKEND == "tensorflow": | ||
return | ||
root = './temp' | ||
dataset = MLDataset(root=root, dataset_name='ml-100k') | ||
data = dataset[0] | ||
assert data.edge_index.shape[0] == 2, "Edge index shape mismatch" | ||
assert len(data.edge_weight) > 0, "Edge weights should not be empty" | ||
assert len(data.user_id) > 0, "User IDs should not be empty" | ||
assert len(data.item_id) > 0, "Item IDs should not be empty" | ||
print("All tests passed!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import tensorlayerx as tlx | ||
from gammagl.utils.smiles import from_smiles | ||
from gammagl.datasets.molecule_net import MoleculeNet | ||
|
||
|
||
def test_moleculenet(): | ||
root = './temp' | ||
dataset = MoleculeNet(root=root, name='ESOL') | ||
data = dataset[0] | ||
assert data.y.shape[1] == 1, "Label shape mismatch" | ||
assert len(data.x) > 0, "Node features should not be empty" | ||
assert data.edge_index.shape[0] == 2, "Edge index shape mismatch" | ||
print("All tests passed!") | ||
|
||
|
||
|
||
|
Oops, something went wrong.