88import control as ct
99from control import NonlinearIOSystem , c2d , common_timebase , isctime , \
1010 isdtime , issiso , ss , tf , tf2ss
11- from control .exception import slycot_check
1211from control .lti import LTI , bandwidth , damp , dcgain , evalfr , poles , zeros
1312
1413
@@ -189,6 +188,10 @@ def test_isdtime(self, objfun, arg, dt, ref, strictref):
189188 assert isctime (obj ) == ref
190189 assert isctime (obj , strict = True ) == strictref
191190
191+ def p (* args ):
192+ # convenience for parametrize below
193+ return pytest .param (* args , marks = pytest .mark .slycot )
194+
192195 @pytest .mark .usefixtures ("editsdefaults" )
193196 @pytest .mark .parametrize ("fcn" , [ct .ss , ct .tf , ct .frd ])
194197 @pytest .mark .parametrize ("nstate, nout, ninp, omega, squeeze, shape" , [
@@ -201,26 +204,26 @@ def test_isdtime(self, objfun, arg, dt, ref, strictref):
201204 [3 , 1 , 1 , 0.1 , False , (1 , 1 )],
202205 [3 , 1 , 1 , [0.1 ], False , (1 , 1 , 1 )],
203206 [3 , 1 , 1 , [0.1 , 1 , 10 ], False , (1 , 1 , 3 )],
204- [ 1 , 2 , 1 , 0.1 , None , (2 , 1 )], # SIMO
205- [ 1 , 2 , 1 , [0.1 ], None , (2 , 1 , 1 )] ,
206- [ 1 , 2 , 1 , [0.1 , 1 , 10 ], None , (2 , 1 , 3 )] ,
207- [ 2 , 2 , 1 , 0.1 , True , (2 ,)] ,
208- [ 2 , 2 , 1 , [0.1 ], True , (2 ,)] ,
209- [ 3 , 2 , 1 , 0.1 , False , (2 , 1 )] ,
210- [ 3 , 2 , 1 , [0.1 ], False , (2 , 1 , 1 )] ,
211- [ 3 , 2 , 1 , [0.1 , 1 , 10 ], False , (2 , 1 , 3 )] ,
212- [ 1 , 1 , 2 , [0.1 , 1 , 10 ], None , (1 , 2 , 3 )] , # MISO
213- [ 2 , 1 , 2 , [0.1 , 1 , 10 ], True , (2 , 3 )] ,
214- [ 3 , 1 , 2 , [0.1 , 1 , 10 ], False , (1 , 2 , 3 )] ,
215- [ 1 , 1 , 2 , 0.1 , None , (1 , 2 )] ,
216- [ 1 , 1 , 2 , 0.1 , True , (2 ,)] ,
217- [ 1 , 1 , 2 , 0.1 , False , (1 , 2 )] ,
218- [ 1 , 2 , 2 , [0.1 , 1 , 10 ], None , (2 , 2 , 3 )] , # MIMO
219- [ 2 , 2 , 2 , [0.1 , 1 , 10 ], True , (2 , 2 , 3 )] ,
220- [ 3 , 2 , 2 , [0.1 , 1 , 10 ], False , (2 , 2 , 3 )] ,
221- [ 1 , 2 , 2 , 0.1 , None , (2 , 2 )] ,
222- [ 2 , 2 , 2 , 0.1 , True , (2 , 2 )] ,
223- [ 3 , 2 , 2 , 0.1 , False , (2 , 2 )] ,
207+ p ( 1 , 2 , 1 , 0.1 , None , (2 , 1 )),
208+ p ( 1 , 2 , 1 , [0.1 ], None , (2 , 1 , 1 )) ,
209+ p ( 1 , 2 , 1 , [0.1 , 1 , 10 ], None , (2 , 1 , 3 )) ,
210+ p ( 2 , 2 , 1 , 0.1 , True , (2 ,)) ,
211+ p ( 2 , 2 , 1 , [0.1 ], True , (2 ,)) ,
212+ p ( 3 , 2 , 1 , 0.1 , False , (2 , 1 )) ,
213+ p ( 3 , 2 , 1 , [0.1 ], False , (2 , 1 , 1 )) ,
214+ p ( 3 , 2 , 1 , [0.1 , 1 , 10 ], False , (2 , 1 , 3 )) ,
215+ p ( 1 , 1 , 2 , [0.1 , 1 , 10 ], None , (1 , 2 , 3 )) , # MISO
216+ p ( 2 , 1 , 2 , [0.1 , 1 , 10 ], True , (2 , 3 )) ,
217+ p ( 3 , 1 , 2 , [0.1 , 1 , 10 ], False , (1 , 2 , 3 )) ,
218+ p ( 1 , 1 , 2 , 0.1 , None , (1 , 2 )) ,
219+ p ( 1 , 1 , 2 , 0.1 , True , (2 ,)) ,
220+ p ( 1 , 1 , 2 , 0.1 , False , (1 , 2 )) ,
221+ p ( 1 , 2 , 2 , [0.1 , 1 , 10 ], None , (2 , 2 , 3 )) , # MIMO
222+ p ( 2 , 2 , 2 , [0.1 , 1 , 10 ], True , (2 , 2 , 3 )) ,
223+ p ( 3 , 2 , 2 , [0.1 , 1 , 10 ], False , (2 , 2 , 3 )) ,
224+ p ( 1 , 2 , 2 , 0.1 , None , (2 , 2 )) ,
225+ p ( 2 , 2 , 2 , 0.1 , True , (2 , 2 )) ,
226+ p ( 3 , 2 , 2 , 0.1 , False , (2 , 2 )) ,
224227 ])
225228 @pytest .mark .parametrize ("omega_type" , ["numpy" , "native" ])
226229 def test_squeeze (self , fcn , nstate , nout , ninp , omega , squeeze , shape ,
@@ -229,9 +232,6 @@ def test_squeeze(self, fcn, nstate, nout, ninp, omega, squeeze, shape,
229232 # Create the system to be tested
230233 if fcn == ct .frd :
231234 sys = fcn (ct .rss (nstate , nout , ninp ), [1e-2 , 1e-1 , 1 , 1e1 , 1e2 ])
232- elif fcn == ct .tf and (nout > 1 or ninp > 1 ) and not slycot_check ():
233- pytest .skip ("Conversion of MIMO systems to transfer functions "
234- "requires slycot." )
235235 else :
236236 sys = fcn (ct .rss (nstate , nout , ninp ))
237237
0 commit comments