Skip to content

Commit 0edf097

Browse files
committed
update np.float to float to fix SciPy 1.20 deprecation warnings
1 parent 9c6c619 commit 0edf097

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

control/tests/input_element_int_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ def test_ss_input_with_0int_dcgain(self):
6363
d = 0
6464
sys = ss(a, b, c, d)
6565
np.testing.assert_allclose(dcgain(sys), 0,
66-
atol=np.finfo(np.float).epsneg)
66+
atol=np.finfo(float).epsneg)

control/tests/timeresp_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -408,15 +408,15 @@ def test_forced_response_step(self, tsystem):
408408
"""Test forced response of SISO systems as step response"""
409409
sys = tsystem.sys
410410
t = tsystem.t
411-
u = np.ones_like(t, dtype=np.float)
411+
u = np.ones_like(t, dtype=float)
412412
yref = tsystem.ystep
413413

414414
tout, yout = forced_response(sys, t, u)
415415
np.testing.assert_array_almost_equal(tout, t)
416416
np.testing.assert_array_almost_equal(yout, yref, decimal=4)
417417

418418
@pytest.mark.parametrize("u",
419-
[np.zeros((10,), dtype=np.float),
419+
[np.zeros((10,), dtype=float),
420420
0] # special algorithm
421421
)
422422
def test_forced_response_initial(self, siso_ss1, u):

control/tests/xferfcn_input_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@
5454

5555

5656
@pytest.mark.parametrize("dtype",
57-
[np.int, np.int8, np.int16, np.int32, np.int64,
58-
np.float, np.float16, np.float32, np.float64,
57+
[int, np.int8, np.int16, np.int32, np.int64,
58+
float, np.float16, np.float32, np.float64,
5959
np.longdouble])
6060
@pytest.mark.parametrize("num, fun", cases.values(), ids=cases.keys())
6161
def test_clean_part(num, fun, dtype):
6262
"""Test clean part for various inputs"""
6363
numa = fun(dtype, num)
6464
num_ = _clean_part(numa)
65-
ref_ = np.array(num, dtype=np.float, ndmin=3)
65+
ref_ = np.array(num, dtype=float, ndmin=3)
6666

6767
assert isinstance(num_, list)
6868
assert np.all([isinstance(part, list) for part in num_])

0 commit comments

Comments
 (0)