Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Aug 13, 2024
1 parent 7627e11 commit 8f63e73
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/classes/test_hypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,9 @@ def test_incidence_matrix(sevenbysix):
len(sevenbysix.nodes),
len(sevenbysix.edges),
)
assert np.allclose(incidence_matrix.A, sevenbysix.incidence_matrix.A)
assert np.allclose(
incidence_matrix.toarray(), sevenbysix.incidence_matrix.toarray()
)

# check the edge and node indexes
assert nodes_idx.tolist() == list(sevenbysix.nodes)
Expand All @@ -1109,7 +1111,9 @@ def test_adjacency_matrix(sevenbysix):
len(sevenbysix.nodes),
len(sevenbysix.nodes),
)
assert np.allclose(adjacency_matrix.A, sevenbysix.s1_adjacency_matrx.A)
assert np.allclose(
adjacency_matrix.toarray(), sevenbysix.s1_adjacency_matrx.toarray()
)
assert node_idx.tolist() == list(sevenbysix.nodes)


Expand All @@ -1122,7 +1126,9 @@ def test_edge_adjacency_matrix(sevenbysix):
len(sevenbysix.edges),
len(sevenbysix.edges),
)
assert np.allclose(adjacency_matrix.A, sevenbysix.s1_edge_adjacency_matrx.A)
assert np.allclose(
adjacency_matrix.toarray(), sevenbysix.s1_edge_adjacency_matrx.toarray()
)
assert node_idx.tolist() == list(sevenbysix.edges)


Expand All @@ -1132,7 +1138,7 @@ def test_auxiliary_matrix_on_nodes(sevenbysix):
aux_matrix, indexes = hg.auxiliary_matrix(index=True)

assert aux_matrix.todense().shape == (len(sevenbysix.nodes), len(sevenbysix.nodes))
assert np.allclose(aux_matrix.A, sevenbysix.s1_adjacency_matrx.A)
assert np.allclose(aux_matrix.toarray(), sevenbysix.s1_adjacency_matrx.toarray())
assert indexes.tolist() == list(sevenbysix.nodes)


Expand All @@ -1142,7 +1148,9 @@ def test_auxiliary_matrix_on_edges(sevenbysix):
aux_matrix, indexes = hg.auxiliary_matrix(node=False, index=True)

assert aux_matrix.todense().shape == (len(sevenbysix.edges), len(sevenbysix.edges))
assert np.allclose(aux_matrix.A, sevenbysix.s1_edge_adjacency_matrx.A)
assert np.allclose(
aux_matrix.toarray(), sevenbysix.s1_edge_adjacency_matrx.Atoarray()
)
assert indexes.tolist() == list(sevenbysix.edges)


Expand Down

0 comments on commit 8f63e73

Please sign in to comment.