Skip to content

Commit b98008a

Browse files
committed
remove test function with duplicate name
1 parent ff960c3 commit b98008a

File tree

1 file changed

+10
-36
lines changed

1 file changed

+10
-36
lines changed

control/tests/timeresp_test.py

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def pole_cancellation(self):
193193
def no_pole_cancellation(self):
194194
return TransferFunction([1.881e+06],
195195
[188.1, 1.881e+06])
196-
196+
197197
@pytest.fixture
198198
def siso_tf_type1(self):
199199
# System Type 1 - Step response not stationary: G(s)=1/s(s+1)
@@ -309,36 +309,6 @@ def test_step_nostates(self, dt):
309309
t, y = step_response(sys)
310310
np.testing.assert_array_equal(y, np.ones(len(t)))
311311

312-
def test_step_info(self):
313-
# From matlab docs:
314-
sys = TransferFunction([1, 5, 5], [1, 1.65, 5, 6.5, 2])
315-
Strue = {
316-
'RiseTime': 3.8456,
317-
'SettlingTime': 27.9762,
318-
'SettlingMin': 2.0689,
319-
'SettlingMax': 2.6873,
320-
'Overshoot': 7.4915,
321-
'Undershoot': 0,
322-
'Peak': 2.6873,
323-
'PeakTime': 8.0530,
324-
'SteadyStateValue': 2.50
325-
}
326-
327-
S = step_info(sys)
328-
329-
Sk = sorted(S.keys())
330-
Sktrue = sorted(Strue.keys())
331-
assert Sk == Sktrue
332-
# Very arbitrary tolerance because I don't know if the
333-
# response from the MATLAB is really that accurate.
334-
# maybe it is a good idea to change the Strue to match
335-
# but I didn't do it because I don't know if it is
336-
# accurate either...
337-
rtol = 2e-2
338-
np.testing.assert_allclose([S[k] for k in Sk],
339-
[Strue[k] for k in Sktrue],
340-
rtol=rtol)
341-
342312
# tolerance for all parameters could be wrong for some systems
343313
# discrete systems time parameters tolerance could be +/-dt
344314
@pytest.mark.parametrize(
@@ -394,17 +364,21 @@ def test_step_info(self):
394364
'SteadyStateValue': np.NaN}, 2e-2)],
395365
indirect=["tsystem"])
396366
def test_step_info(self, tsystem, info_true, tolerance):
397-
""" """
367+
"""Test step info for SISO systems"""
398368
info = step_info(tsystem)
399369

400370
info_true_sorted = sorted(info_true.keys())
401371
info_sorted = sorted(info.keys())
402-
403372
assert info_sorted == info_true_sorted
404373

405-
np.testing.assert_allclose([info_true[k] for k in info_true_sorted],
406-
[info[k] for k in info_sorted],
407-
rtol=tolerance)
374+
for k in info:
375+
np.testing.assert_allclose(info[k], info_true[k], rtol=tolerance,
376+
err_msg=f"key {k} does not match")
377+
378+
def test_step_info_mimo(self, tsystem, info_true, tolearance):
379+
"""Test step info for MIMO systems"""
380+
# TODO: implement
381+
pass
408382

409383
def test_step_pole_cancellation(self, pole_cancellation,
410384
no_pole_cancellation):

0 commit comments

Comments
 (0)