From 8f63e73d038524256b005713766fb56eb1250889 Mon Sep 17 00:00:00 2001 From: "ryan.danehy@pnnl.gov" Date: Tue, 13 Aug 2024 12:03:13 -0700 Subject: [PATCH] Testing --- tests/classes/test_hypergraph.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/classes/test_hypergraph.py b/tests/classes/test_hypergraph.py index 341c2e5e..03eb3334 100644 --- a/tests/classes/test_hypergraph.py +++ b/tests/classes/test_hypergraph.py @@ -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) @@ -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) @@ -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) @@ -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) @@ -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)