Skip to content

Commit

Permalink
Fix loading the full version of shrec16
Browse files Browse the repository at this point in the history
  • Loading branch information
ffl096 committed Jan 2, 2025
1 parent 71bc7da commit 09b40ef
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion test/datasets/test_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_stanford_bunny(self):
with pytest.raises(ValueError):
stanford_bunny("polyhedral")

def test_shrec_16(self):
def test_shrec_16_small(self):
"""Test shrec_16."""
shrec_training, shrec_testing = shrec_16(size="small")

Expand All @@ -36,6 +36,23 @@ def test_shrec_16(self):
assert len(shrec_training["face_feat"]) == 100
assert len(shrec_testing["face_feat"]) == 20

def test_shrec_16_full(self):
"""Test shrec_16."""
shrec_training, shrec_testing = shrec_16(size="full")

assert len(shrec_training["complexes"]) == 480
assert len(shrec_testing["complexes"]) == 120
assert len(shrec_training["label"]) == 480
assert len(shrec_testing["label"]) == 120
assert len(shrec_training["node_feat"]) == 480
assert len(shrec_testing["node_feat"]) == 120
assert len(shrec_training["edge_feat"]) == 480
assert len(shrec_testing["edge_feat"]) == 120
assert len(shrec_training["face_feat"]) == 480
assert len(shrec_testing["face_feat"]) == 120

def test_shrec_16_invalid(self):
"""Test shrec_16."""
with pytest.raises(ValueError):
shrec_16(size="huge")

Expand Down
2 changes: 1 addition & 1 deletion toponetx/datasets/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def shrec_16(size: Literal["full", "small"] = "full"):
test_data = {
"complexes": test_complexes,
"label": np.load(zip_ref.open("test/labels.npy")),
"node_feat": np.load(zip_ref.open("test/node_feat.npy")),
"node_feat": np.load(zip_ref.open("test/node_feat.npy"), allow_pickle=True),
"edge_feat": np.load(zip_ref.open("test/edge_feat.npy")),
"face_feat": np.load(zip_ref.open("test/face_feat.npy")),
}
Expand Down

0 comments on commit 09b40ef

Please sign in to comment.