From f35331b7075860efeafbac805e188a43bc2f06ba Mon Sep 17 00:00:00 2001 From: Richard Murray Date: Thu, 18 Feb 2021 08:31:12 -0800 Subject: [PATCH] update np.float to float to fix SciPy 1.20 deprecation warnings --- control/tests/input_element_int_test.py | 2 +- control/tests/timeresp_test.py | 4 ++-- control/tests/xferfcn_input_test.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/control/tests/input_element_int_test.py b/control/tests/input_element_int_test.py index 94e5efcb5..5b3b801c6 100644 --- a/control/tests/input_element_int_test.py +++ b/control/tests/input_element_int_test.py @@ -63,4 +63,4 @@ def test_ss_input_with_0int_dcgain(self): d = 0 sys = ss(a, b, c, d) np.testing.assert_allclose(dcgain(sys), 0, - atol=np.finfo(np.float).epsneg) + atol=np.finfo(float).epsneg) diff --git a/control/tests/timeresp_test.py b/control/tests/timeresp_test.py index f6c15f691..751cd35b0 100644 --- a/control/tests/timeresp_test.py +++ b/control/tests/timeresp_test.py @@ -408,7 +408,7 @@ def test_forced_response_step(self, tsystem): """Test forced response of SISO systems as step response""" sys = tsystem.sys t = tsystem.t - u = np.ones_like(t, dtype=np.float) + u = np.ones_like(t, dtype=float) yref = tsystem.ystep tout, yout = forced_response(sys, t, u) @@ -416,7 +416,7 @@ def test_forced_response_step(self, tsystem): np.testing.assert_array_almost_equal(yout, yref, decimal=4) @pytest.mark.parametrize("u", - [np.zeros((10,), dtype=np.float), + [np.zeros((10,), dtype=float), 0] # special algorithm ) def test_forced_response_initial(self, siso_ss1, u): diff --git a/control/tests/xferfcn_input_test.py b/control/tests/xferfcn_input_test.py index 995f6ac03..00024ba4c 100644 --- a/control/tests/xferfcn_input_test.py +++ b/control/tests/xferfcn_input_test.py @@ -54,15 +54,15 @@ @pytest.mark.parametrize("dtype", - [np.int, np.int8, np.int16, np.int32, np.int64, - np.float, np.float16, np.float32, np.float64, + [int, np.int8, np.int16, np.int32, np.int64, + float, np.float16, np.float32, np.float64, np.longdouble]) @pytest.mark.parametrize("num, fun", cases.values(), ids=cases.keys()) def test_clean_part(num, fun, dtype): """Test clean part for various inputs""" numa = fun(dtype, num) num_ = _clean_part(numa) - ref_ = np.array(num, dtype=np.float, ndmin=3) + ref_ = np.array(num, dtype=float, ndmin=3) assert isinstance(num_, list) assert np.all([isinstance(part, list) for part in num_]) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy