@@ -92,15 +92,13 @@ def pytest_configure(config):
9292 config .addinivalue_line ("markers" , "slow: mark test as slow to run" )
9393
9494
95- def assert_tf_close_coeff (tf_a , tf_b , rtol = 1e-5 , atol = 1e-8 ):
95+ def assert_tf_close_coeff (actual , desired , rtol = 1e-5 , atol = 1e-8 ):
9696 """Check if two transfer functions have close coefficients.
9797
9898 Parameters
9999 ----------
100- tf_a : TransferFunction
101- First transfer function.
102- tf_b : TransferFunction
103- Second transfer function.
100+ actual, desired : TransferFunction
101+ Transfer functions to compare.
104102 rtol : float
105103 Relative tolerance for ``np.testing.assert_allclose``.
106104 atol : float
@@ -111,18 +109,18 @@ def assert_tf_close_coeff(tf_a, tf_b, rtol=1e-5, atol=1e-8):
111109 AssertionError
112110 """
113111 # Check number of outputs and inputs
114- assert tf_a .noutputs == tf_b .noutputs
115- assert tf_a .ninputs == tf_b .ninputs
112+ assert actual .noutputs == desired .noutputs
113+ assert actual .ninputs == desired .ninputs
116114 # Check timestep
117- assert tf_a .dt == tf_b .dt
115+ assert actual .dt == desired .dt
118116 # Check coefficient arrays
119- for i in range (tf_a .noutputs ):
120- for j in range (tf_a .ninputs ):
117+ for i in range (actual .noutputs ):
118+ for j in range (actual .ninputs ):
121119 np .testing .assert_allclose (
122- tf_a .num [i ][j ],
123- tf_b .num [i ][j ],
120+ actual .num [i ][j ],
121+ desired .num [i ][j ],
124122 rtol = rtol , atol = atol )
125123 np .testing .assert_allclose (
126- tf_a .den [i ][j ],
127- tf_b .den [i ][j ],
124+ actual .den [i ][j ],
125+ desired .den [i ][j ],
128126 rtol = rtol , atol = atol )
0 commit comments