From 9d7c8b257831281a3184bbcccbff5a00835a0a66 Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Fri, 5 Apr 2024 13:33:34 +0100 Subject: [PATCH] Fix test suite for Numpy 2 The only change needed was a now-removed alias. Also fix a typo in a test file's name that otherwise took me literally 6 goes to type even with tab completion. --- tests/digraph/test_adjacency_matrix.py | 8 ++++---- ...test_adjencency_matrix.py => test_adjacency_matrix.py} | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) rename tests/graph/{test_adjencency_matrix.py => test_adjacency_matrix.py} (98%) diff --git a/tests/digraph/test_adjacency_matrix.py b/tests/digraph/test_adjacency_matrix.py index 38d998559f..7b85a31eff 100644 --- a/tests/digraph/test_adjacency_matrix.py +++ b/tests/digraph/test_adjacency_matrix.py @@ -153,10 +153,10 @@ def test_random_graph_float_dtype(self): def test_non_zero_null(self): input_matrix = np.array( - [[np.Inf, 1, np.Inf], [1, np.Inf, 1], [np.Inf, 1, np.Inf]], + [[np.inf, 1, np.inf], [1, np.inf, 1], [np.inf, 1, np.inf]], dtype=np.float64, ) - graph = rustworkx.PyDiGraph.from_adjacency_matrix(input_matrix, null_value=np.Inf) + graph = rustworkx.PyDiGraph.from_adjacency_matrix(input_matrix, null_value=np.inf) adj_matrix = rustworkx.adjacency_matrix(graph, float) expected_matrix = np.array( [[0.0, 1.0, 0.0], [1.0, 0.0, 1.0], [0.0, 1.0, 0.0]], @@ -231,10 +231,10 @@ def test_random_graph_complex_dtype(self): def test_non_zero_null(self): input_matrix = np.array( - [[np.Inf, 1, np.Inf], [1, np.Inf, 1], [np.Inf, 1, np.Inf]], + [[np.inf, 1, np.inf], [1, np.inf, 1], [np.inf, 1, np.inf]], dtype=np.complex128, ) - graph = rustworkx.PyDiGraph.from_complex_adjacency_matrix(input_matrix, null_value=np.Inf) + graph = rustworkx.PyDiGraph.from_complex_adjacency_matrix(input_matrix, null_value=np.inf) expected = [ (0, 1, 1 + 0j), (1, 0, 1 + 0j), diff --git a/tests/graph/test_adjencency_matrix.py b/tests/graph/test_adjacency_matrix.py similarity index 98% rename from tests/graph/test_adjencency_matrix.py rename to tests/graph/test_adjacency_matrix.py index d303c75506..4944ea4189 100644 --- a/tests/graph/test_adjencency_matrix.py +++ b/tests/graph/test_adjacency_matrix.py @@ -165,10 +165,10 @@ def test_graph_to_digraph_adjacency_matrix(self): def test_non_zero_null(self): input_matrix = np.array( - [[np.Inf, 1, np.Inf], [1, np.Inf, 1], [np.Inf, 1, np.Inf]], + [[np.inf, 1, np.inf], [1, np.inf, 1], [np.inf, 1, np.inf]], dtype=np.float64, ) - graph = rustworkx.PyGraph.from_adjacency_matrix(input_matrix, null_value=np.Inf) + graph = rustworkx.PyGraph.from_adjacency_matrix(input_matrix, null_value=np.inf) adj_matrix = rustworkx.adjacency_matrix(graph, float) expected_matrix = np.array([[0, 1, 0], [1, 0, 1], [0, 1, 0]], dtype=np.float64) self.assertTrue(np.array_equal(adj_matrix, expected_matrix)) @@ -231,10 +231,10 @@ def test_random_graph_complex_dtype(self): def test_non_zero_null(self): input_matrix = np.array( - [[np.Inf, 1, np.Inf], [1, np.Inf, 1], [np.Inf, 1, np.Inf]], + [[np.inf, 1, np.inf], [1, np.inf, 1], [np.inf, 1, np.inf]], dtype=np.complex128, ) - graph = rustworkx.PyGraph.from_complex_adjacency_matrix(input_matrix, null_value=np.Inf) + graph = rustworkx.PyGraph.from_complex_adjacency_matrix(input_matrix, null_value=np.inf) expected = [ (0, 1, 1 + 0j), (1, 2, 1 + 0j),