Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
demi authored and demi committed Jul 12, 2024
1 parent e0b07d0 commit 1c50245
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setup_method(self):
),
edge_index=torch.tensor([[0, 1, 2, 3], [1, 0, 3, 2]], dtype=torch.long),
)
self.lifting = NodeAttributeLifting(attribute_idx=0)
self.lifting = NodeAttributeLifting(attribute_idx=1)

def test_lift_topology(self):
# Test the lift_topology method
Expand All @@ -39,10 +39,24 @@ def test_lift_topology(self):
]
).to_sparse_coo()

# Print for debugging
print("Expected Incidence Matrix (Dense):")
print(expected_incidence_1.to_dense())

print("Actual Incidence Matrix (Dense):")
print(lifted_topology["incidence_hyperedges"].to_dense())

assert torch.equal(
expected_incidence_1.to_dense(),
lifted_topology["incidence_hyperedges"].to_dense(),
), "Something is wrong with incidence_hyperedges."
assert (
expected_n_hyperedges == lifted_topology["num_hyperedges"]
), "Something is wrong with the number of hyperedges."


# Running the test manually for debugging purposes
if __name__ == "__main__":
test = TestNodeAttributeLifting()
test.setup_method()
test.test_lift_topology()

0 comments on commit 1c50245

Please sign in to comment.