Skip to content

Commit fb0519c

Browse files
committed
Correct use of slycotonly in statesp_test.py
slycontonly is not a fixture.
1 parent 2d5738a commit fb0519c

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

control/tests/statesp_test.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from control.statesp import StateSpace, _convert_to_statespace, \
2323
_rss_generate, _statesp_defaults, drss, linfnorm, rss, ss, tf2ss
2424
from control.xferfcn import TransferFunction, ss2tf
25-
from .conftest import assert_tf_close_coeff
25+
from .conftest import assert_tf_close_coeff, slycotonly
2626

2727
class TestStateSpace:
2828
"""Tests for the StateSpace class."""
@@ -228,7 +228,7 @@ def test_zero_empty(self):
228228
sys = _convert_to_statespace(TransferFunction([1], [1, 2, 1]))
229229
np.testing.assert_array_equal(sys.zeros(), np.array([]))
230230

231-
@pytest.mark.usefixtures("slycotonly")
231+
@slycotonly
232232
def test_zero_siso(self, sys222):
233233
"""Evaluate the zeros of a SISO system."""
234234
# extract only first input / first output system of sys222. This system is denoted sys111
@@ -258,7 +258,7 @@ def test_zero_mimo_sys222_square(self, sys222):
258258
true_z = np.sort([-10.568501, 3.368501])
259259
np.testing.assert_array_almost_equal(z, true_z)
260260

261-
@pytest.mark.usefixtures("slycotonly")
261+
@slycotonly
262262
def test_zero_mimo_sys623_non_square(self, sys623):
263263
"""Evaluate the zeros of a non square MIMO system."""
264264

@@ -405,7 +405,7 @@ def test_add_sub_mimo_siso(self):
405405
ss2tf(result).minreal(),
406406
)
407407

408-
@pytest.mark.usefixtures("slycotonly")
408+
@slycotonly
409409
@pytest.mark.parametrize(
410410
"left, right, expected",
411411
[
@@ -480,7 +480,7 @@ def test_mul_mimo_siso(self, left, right, expected):
480480
ss2tf(result).minreal(),
481481
)
482482

483-
@pytest.mark.usefixtures("slycotonly")
483+
@slycotonly
484484
@pytest.mark.parametrize(
485485
"left, right, expected",
486486
[
@@ -555,7 +555,7 @@ def test_rmul_mimo_siso(self, left, right, expected):
555555
ss2tf(result).minreal(),
556556
)
557557

558-
@pytest.mark.usefixtures("slycotonly")
558+
@slycotonly
559559
@pytest.mark.parametrize("power", [0, 1, 3, -3])
560560
@pytest.mark.parametrize("sysname", ["sys222", "sys322"])
561561
def test_pow(self, request, sysname, power):
@@ -574,7 +574,7 @@ def test_pow(self, request, sysname, power):
574574
np.testing.assert_allclose(expected.C, result.C)
575575
np.testing.assert_allclose(expected.D, result.D)
576576

577-
@pytest.mark.usefixtures("slycotonly")
577+
@slycotonly
578578
@pytest.mark.parametrize("order", ["left", "right"])
579579
@pytest.mark.parametrize("sysname", ["sys121", "sys222", "sys322"])
580580
def test_pow_inv(self, request, sysname, order):
@@ -598,7 +598,7 @@ def test_pow_inv(self, request, sysname, order):
598598
# Check that the output is the same as the input
599599
np.testing.assert_allclose(R.outputs, U)
600600

601-
@pytest.mark.usefixtures("slycotonly")
601+
@slycotonly
602602
def test_truediv(self, sys222, sys322):
603603
"""Test state space truediv"""
604604
for sys in [sys222, sys322]:
@@ -617,7 +617,7 @@ def test_truediv(self, sys222, sys322):
617617
ss2tf(result).minreal(),
618618
)
619619

620-
@pytest.mark.usefixtures("slycotonly")
620+
@slycotonly
621621
def test_rtruediv(self, sys222, sys322):
622622
"""Test state space rtruediv"""
623623
for sys in [sys222, sys322]:
@@ -718,7 +718,7 @@ def test_freq_resp(self):
718718
mag, phase, omega = sys.freqresp(true_omega)
719719
np.testing.assert_almost_equal(mag, true_mag)
720720

721-
@pytest.mark.usefixtures("slycotonly")
721+
@slycotonly
722722
def test_minreal(self):
723723
"""Test a minreal model reduction."""
724724
# A = [-2, 0.5, 0; 0.5, -0.3, 0; 0, 0, -0.1]
@@ -1512,22 +1512,25 @@ def dt_siso(self, request):
15121512
name, systype, sysargs, dt, refgpeak, reffpeak = request.param
15131513
return ct.c2d(systype(*sysargs), dt), refgpeak, reffpeak
15141514

1515-
@pytest.mark.usefixtures('slycotonly', 'ignore_future_warning')
1515+
@slycotonly
1516+
@pytest.mark.usefixtures('ignore_future_warning')
15161517
def test_linfnorm_ct_siso(self, ct_siso):
15171518
sys, refgpeak, reffpeak = ct_siso
15181519
gpeak, fpeak = linfnorm(sys)
15191520
np.testing.assert_allclose(gpeak, refgpeak)
15201521
np.testing.assert_allclose(fpeak, reffpeak)
15211522

1522-
@pytest.mark.usefixtures('slycotonly', 'ignore_future_warning')
1523+
@slycotonly
1524+
@pytest.mark.usefixtures('ignore_future_warning')
15231525
def test_linfnorm_dt_siso(self, dt_siso):
15241526
sys, refgpeak, reffpeak = dt_siso
15251527
gpeak, fpeak = linfnorm(sys)
15261528
# c2d pole-mapping has round-off
15271529
np.testing.assert_allclose(gpeak, refgpeak)
15281530
np.testing.assert_allclose(fpeak, reffpeak)
15291531

1530-
@pytest.mark.usefixtures('slycotonly', 'ignore_future_warning')
1532+
@slycotonly
1533+
@pytest.mark.usefixtures('ignore_future_warning')
15311534
def test_linfnorm_ct_mimo(self, ct_siso):
15321535
siso, refgpeak, reffpeak = ct_siso
15331536
sys = ct.append(siso, siso)

0 commit comments

Comments
 (0)