summaryrefslogtreecommitdiff
path: root/networkx/tests
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2020-11-20 13:20:12 -0800
committerGitHub <noreply@github.com>2020-11-20 13:20:12 -0800
commite73e538bbe6f090c79e65c2e6c44272ab77503ec (patch)
treea6249bbf6e14c753e15cacc1f5d0d47ed14f8d71 /networkx/tests
parent4079542016391d8b5835998e115b70b277de1a71 (diff)
downloadnetworkx-e73e538bbe6f090c79e65c2e6c44272ab77503ec.tar.gz
MAINT: remove deprecated numpy type aliases. (#4373)
Suppress deprecation warnings from numpy 1.20.
Diffstat (limited to 'networkx/tests')
-rw-r--r--networkx/tests/test_convert_numpy.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/networkx/tests/test_convert_numpy.py b/networkx/tests/test_convert_numpy.py
index 48269085..debd6d82 100644
--- a/networkx/tests/test_convert_numpy.py
+++ b/networkx/tests/test_convert_numpy.py
@@ -130,23 +130,23 @@ class TestConvertNumpyMatrix:
G = nx.from_numpy_matrix(A)
assert type(G[0][0]["weight"]) == int
- A = np.matrix([[1]]).astype(np.float)
+ A = np.matrix([[1]]).astype(float)
G = nx.from_numpy_matrix(A)
assert type(G[0][0]["weight"]) == float
- A = np.matrix([[1]]).astype(np.str)
+ A = np.matrix([[1]]).astype(str)
G = nx.from_numpy_matrix(A)
assert type(G[0][0]["weight"]) == str
- A = np.matrix([[1]]).astype(np.bool)
+ A = np.matrix([[1]]).astype(bool)
G = nx.from_numpy_matrix(A)
assert type(G[0][0]["weight"]) == bool
- A = np.matrix([[1]]).astype(np.complex)
+ A = np.matrix([[1]]).astype(complex)
G = nx.from_numpy_matrix(A)
assert type(G[0][0]["weight"]) == complex
- A = np.matrix([[1]]).astype(np.object)
+ A = np.matrix([[1]]).astype(object)
pytest.raises(TypeError, nx.from_numpy_matrix, A)
G = nx.cycle_graph(3)
@@ -332,23 +332,23 @@ class TestConvertNumpyArray:
G = nx.from_numpy_array(A)
assert type(G[0][0]["weight"]) == int
- A = np.array([[1]]).astype(np.float)
+ A = np.array([[1]]).astype(float)
G = nx.from_numpy_array(A)
assert type(G[0][0]["weight"]) == float
- A = np.array([[1]]).astype(np.str)
+ A = np.array([[1]]).astype(str)
G = nx.from_numpy_array(A)
assert type(G[0][0]["weight"]) == str
- A = np.array([[1]]).astype(np.bool)
+ A = np.array([[1]]).astype(bool)
G = nx.from_numpy_array(A)
assert type(G[0][0]["weight"]) == bool
- A = np.array([[1]]).astype(np.complex)
+ A = np.array([[1]]).astype(complex)
G = nx.from_numpy_array(A)
assert type(G[0][0]["weight"]) == complex
- A = np.array([[1]]).astype(np.object)
+ A = np.array([[1]]).astype(object)
pytest.raises(TypeError, nx.from_numpy_array, A)
def test_from_numpy_array_dtype(self):