@@ -1250,31 +1250,34 @@ def test_lineariosys_statespace(self, tsys):
1250
1250
1251
1251
@pytest .mark .parametrize (
1252
1252
"Pout, Pin, C, op, PCout, PCin" , [
1253
- (2 , 2 , ct . rss ( 2 , 2 , 2 ) , ct .LinearIOSystem .__mul__ , 2 , 2 ),
1253
+ (2 , 2 , ' rss' , ct .LinearIOSystem .__mul__ , 2 , 2 ),
1254
1254
(2 , 2 , 2 , ct .LinearIOSystem .__mul__ , 2 , 2 ),
1255
1255
(2 , 3 , 2 , ct .LinearIOSystem .__mul__ , 2 , 3 ),
1256
1256
(2 , 2 , np .random .rand (2 , 2 ), ct .LinearIOSystem .__mul__ , 2 , 2 ),
1257
- (2 , 2 , ct . rss ( 2 , 2 , 2 ) , ct .LinearIOSystem .__rmul__ , 2 , 2 ),
1257
+ (2 , 2 , ' rss' , ct .LinearIOSystem .__rmul__ , 2 , 2 ),
1258
1258
(2 , 2 , 2 , ct .LinearIOSystem .__rmul__ , 2 , 2 ),
1259
1259
(2 , 3 , 2 , ct .LinearIOSystem .__rmul__ , 2 , 3 ),
1260
1260
(2 , 2 , np .random .rand (2 , 2 ), ct .LinearIOSystem .__rmul__ , 2 , 2 ),
1261
- (2 , 2 , ct . rss ( 2 , 2 , 2 ) , ct .LinearIOSystem .__add__ , 2 , 2 ),
1261
+ (2 , 2 , ' rss' , ct .LinearIOSystem .__add__ , 2 , 2 ),
1262
1262
(2 , 2 , 2 , ct .LinearIOSystem .__add__ , 2 , 2 ),
1263
1263
(2 , 2 , np .random .rand (2 , 2 ), ct .LinearIOSystem .__add__ , 2 , 2 ),
1264
- (2 , 2 , ct . rss ( 2 , 2 , 2 ) , ct .LinearIOSystem .__radd__ , 2 , 2 ),
1264
+ (2 , 2 , ' rss' , ct .LinearIOSystem .__radd__ , 2 , 2 ),
1265
1265
(2 , 2 , 2 , ct .LinearIOSystem .__radd__ , 2 , 2 ),
1266
1266
(2 , 2 , np .random .rand (2 , 2 ), ct .LinearIOSystem .__radd__ , 2 , 2 ),
1267
- (2 , 2 , ct . rss ( 2 , 2 , 2 ) , ct .LinearIOSystem .__sub__ , 2 , 2 ),
1267
+ (2 , 2 , ' rss' , ct .LinearIOSystem .__sub__ , 2 , 2 ),
1268
1268
(2 , 2 , 2 , ct .LinearIOSystem .__sub__ , 2 , 2 ),
1269
1269
(2 , 2 , np .random .rand (2 , 2 ), ct .LinearIOSystem .__sub__ , 2 , 2 ),
1270
- (2 , 2 , ct . rss ( 2 , 2 , 2 ) , ct .LinearIOSystem .__rsub__ , 2 , 2 ),
1270
+ (2 , 2 , ' rss' , ct .LinearIOSystem .__rsub__ , 2 , 2 ),
1271
1271
(2 , 2 , 2 , ct .LinearIOSystem .__rsub__ , 2 , 2 ),
1272
1272
(2 , 2 , np .random .rand (2 , 2 ), ct .LinearIOSystem .__rsub__ , 2 , 2 ),
1273
1273
1274
1274
])
1275
1275
def test_operand_conversion (self , Pout , Pin , C , op , PCout , PCin ):
1276
1276
P = ct .LinearIOSystem (
1277
1277
ct .rss (2 , Pout , Pin , strictly_proper = True ), name = 'P' )
1278
+ if isinstance (C , str ) and C == 'rss' :
1279
+ # Need to generate inside class to avoid matrix deprecation error
1280
+ C = ct .rss (2 , 2 , 2 )
1278
1281
PC = op (P , C )
1279
1282
assert isinstance (PC , ct .LinearIOSystem )
1280
1283
assert isinstance (PC , ct .StateSpace )
@@ -1283,20 +1286,24 @@ def test_operand_conversion(self, Pout, Pin, C, op, PCout, PCin):
1283
1286
1284
1287
@pytest .mark .parametrize (
1285
1288
"Pout, Pin, C, op" , [
1286
- (2 , 2 , ct . rss ( 2 , 3 , 2 ) , ct .LinearIOSystem .__mul__ ),
1287
- (2 , 2 , ct . rss ( 2 , 2 , 3 ) , ct .LinearIOSystem .__rmul__ ),
1288
- (2 , 2 , ct . rss ( 2 , 3 , 2 ) , ct .LinearIOSystem .__add__ ),
1289
- (2 , 2 , ct . rss ( 2 , 2 , 3 ) , ct .LinearIOSystem .__radd__ ),
1289
+ (2 , 2 , 'rss32' , ct .LinearIOSystem .__mul__ ),
1290
+ (2 , 2 , 'rss23' , ct .LinearIOSystem .__rmul__ ),
1291
+ (2 , 2 , 'rss32' , ct .LinearIOSystem .__add__ ),
1292
+ (2 , 2 , 'rss23' , ct .LinearIOSystem .__radd__ ),
1290
1293
(2 , 3 , 2 , ct .LinearIOSystem .__add__ ),
1291
1294
(2 , 3 , 2 , ct .LinearIOSystem .__radd__ ),
1292
- (2 , 2 , ct . rss ( 2 , 3 , 2 ) , ct .LinearIOSystem .__sub__ ),
1293
- (2 , 2 , ct . rss ( 2 , 2 , 3 ) , ct .LinearIOSystem .__rsub__ ),
1295
+ (2 , 2 , 'rss32' , ct .LinearIOSystem .__sub__ ),
1296
+ (2 , 2 , 'rss23' , ct .LinearIOSystem .__rsub__ ),
1294
1297
(2 , 3 , 2 , ct .LinearIOSystem .__sub__ ),
1295
1298
(2 , 3 , 2 , ct .LinearIOSystem .__rsub__ ),
1296
1299
])
1297
1300
def test_operand_incompatible (self , Pout , Pin , C , op ):
1298
1301
P = ct .LinearIOSystem (
1299
1302
ct .rss (2 , Pout , Pin , strictly_proper = True ), name = 'P' )
1303
+ if isinstance (C , str ) and C == 'rss32' :
1304
+ C = ct .rss (2 , 3 , 2 )
1305
+ elif isinstance (C , str ) and C == 'rss23' :
1306
+ C = ct .rss (2 , 2 , 3 )
1300
1307
with pytest .raises (ValueError , match = "incompatible" ):
1301
1308
PC = op (P , C )
1302
1309
0 commit comments