Skip to content

Commit 258e28e

Browse files
committed
fix unit test issue (change in error message)
1 parent 8c6565b commit 258e28e

File tree

7 files changed

+23
-22
lines changed

7 files changed

+23
-22
lines changed

control/mateqn.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ def lyap(A, Q, C=None, E=None, method=None):
109109
method = _slycot_or_scipy(method)
110110
if method == 'slycot':
111111
if sb03md is None:
112-
raise ControlSlycot("Can't find Slycot module 'sb03md'")
112+
raise ControlSlycot("Can't find slycot module 'sb03md'")
113113
if sb04md is None:
114-
raise ControlSlycot("Can't find Slycot module 'sb04md'")
114+
raise ControlSlycot("Can't find slycot module 'sb04md'")
115115

116116
# Reshape input arrays
117117
A = np.array(A, ndmin=2)
@@ -171,7 +171,7 @@ def lyap(A, Q, C=None, E=None, method=None):
171171
from slycot import sg03ad
172172

173173
except ImportError:
174-
raise ControlSlycot("Can't find Slycot module 'sg03ad'")
174+
raise ControlSlycot("Can't find slycot module 'sg03ad'")
175175

176176
# Solve the generalized Lyapunov equation by calling Slycot
177177
# function sg03ad
@@ -237,11 +237,11 @@ def dlyap(A, Q, C=None, E=None, method=None):
237237
if method == 'slycot':
238238
# Make sure we have access to the right slycot routines
239239
if sb03md is None:
240-
raise ControlSlycot("Can't find Slycot module 'sb03md'")
240+
raise ControlSlycot("Can't find slycot module 'sb03md'")
241241
if sb04qd is None:
242-
raise ControlSlycot("Can't find Slycot module 'sb04qd'")
242+
raise ControlSlycot("Can't find slycot module 'sb04qd'")
243243
if sg03ad is None:
244-
raise ControlSlycot("Can't find Slycot module 'sg03ad'")
244+
raise ControlSlycot("Can't find slycot module 'sg03ad'")
245245

246246
# Reshape input arrays
247247
A = np.array(A, ndmin=2)
@@ -404,12 +404,12 @@ def care(A, B, Q, R=None, S=None, E=None, stabilizing=True, method=None,
404404
try:
405405
from slycot import sb02md
406406
except ImportError:
407-
raise ControlSlycot("Can't find Slycot module 'sb02md'")
407+
raise ControlSlycot("Can't find slycot module 'sb02md'")
408408

409409
try:
410410
from slycot import sb02mt
411411
except ImportError:
412-
raise ControlSlycot("Can't find Slycot module 'sb02mt'")
412+
raise ControlSlycot("Can't find slycot module 'sb02mt'")
413413

414414
# Solve the standard algebraic Riccati equation by calling Slycot
415415
# functions sb02mt and sb02md
@@ -450,7 +450,7 @@ def care(A, B, Q, R=None, S=None, E=None, stabilizing=True, method=None,
450450
try:
451451
from slycot import sg02ad
452452
except ImportError:
453-
raise ControlSlycot("Can't find Slycot module 'sg02ad'")
453+
raise ControlSlycot("Can't find slycot module sg02ad")
454454

455455
# Solve the generalized algebraic Riccati equation by calling the
456456
# Slycot function sg02ad
@@ -569,7 +569,7 @@ def dare(A, B, Q, R, S=None, E=None, stabilizing=True, method=None,
569569
try:
570570
from slycot import sg02ad
571571
except ImportError:
572-
raise ControlSlycot("Can't find Slycot module 'sg02ad'")
572+
raise ControlSlycot("Can't find slycot module sg02ad")
573573

574574
# Initialize optional matrices
575575
S = np.zeros((n, m)) if S is None else np.array(S, ndmin=2)

control/modelsimp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def balanced_reduction(sys, orders, method='truncate', alpha=None):
295295
ValueError
296296
If `method` is not 'truncate' or 'matchdc'.
297297
ImportError
298-
If Slycot routine ab09ad, ab09md, or ab09nd is not found.
298+
If slycot routine ab09ad, ab09md, or ab09nd is not found.
299299
ValueError
300300
If there are more unstable modes than any value in orders.
301301
@@ -314,12 +314,12 @@ def balanced_reduction(sys, orders, method='truncate', alpha=None):
314314
from slycot import ab09ad, ab09md
315315
except ImportError:
316316
raise ControlSlycot(
317-
"can't find Slycot subroutine ab09md or ab09ad")
317+
"can't find slycot subroutine ab09md or ab09ad")
318318
elif method == 'matchdc':
319319
try:
320320
from slycot import ab09nd
321321
except ImportError:
322-
raise ControlSlycot("can't find Slycot subroutine ab09nd")
322+
raise ControlSlycot("can't find slycot subroutine ab09nd")
323323

324324
# Check for ss system object, need a utility for this?
325325

control/robust.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def h2syn(P, nmeas, ncon):
3535
Raises
3636
------
3737
ImportError
38-
If Slycot routine sb10hd is not loaded.
38+
If slycot routine sb10hd is not loaded.
3939
4040
See Also
4141
--------

control/statefbk.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def place_varga(A, B, p, dtime=False, alpha=None):
170170
try:
171171
from slycot import sb01bd
172172
except ImportError:
173-
raise ControlSlycot("can't find slycot module 'sb01bd'")
173+
raise ControlSlycot("can't find slycot module sb01bd")
174174

175175
# Convert the system inputs to NumPy arrays
176176
A_mat = np.array(A)
@@ -1200,7 +1200,7 @@ def gram(sys, type):
12001200
# Compute Gramian by the Slycot routine sb03md
12011201
# make sure Slycot is installed
12021202
if sb03md is None:
1203-
raise ControlSlycot("can't find slycot module 'sb03md'")
1203+
raise ControlSlycot("can't find slycot module sb03md")
12041204
if type == 'c':
12051205
tra = 'T'
12061206
C = -sys.B @ sys.B.T
@@ -1218,7 +1218,7 @@ def gram(sys, type):
12181218
elif type == 'cf' or type == 'of':
12191219
# Compute Cholesky factored Gramian from Slycot routine sb03od
12201220
if sb03od is None:
1221-
raise ControlSlycot("can't find slycot module 'sb03od'")
1221+
raise ControlSlycot("can't find slycot module sb03od")
12221222
tra = 'N'
12231223
n = sys.nstates
12241224
Q = np.zeros((n, n))

control/statesp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ def minreal(self, tol=0.0):
11931193
return StateSpace(A[:nr, :nr], B[:nr, :self.ninputs],
11941194
C[:self.noutputs, :nr], self.D, self.dt)
11951195
except ImportError:
1196-
raise TypeError("minreal requires Slycot tb01pd")
1196+
raise TypeError("minreal requires slycot tb01pd")
11971197
else:
11981198
return StateSpace(self)
11991199

@@ -2015,7 +2015,7 @@ def linfnorm(sys, tol=1e-10):
20152015
20162016
"""
20172017
if ab13dd is None:
2018-
raise ControlSlycot("Can't find slycot module 'ab13dd'")
2018+
raise ControlSlycot("Can't find slycot module ab13dd")
20192019

20202020
a, b, c, d = ssdata(_convert_to_statespace(sys))
20212021
e = np.eye(a.shape[0])

control/stochsys.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ def create_estimator_iosystem(
469469
# Set the output matrices
470470
if C is not None:
471471
# Make sure we have full system output (allowing for numerical errors)
472-
if not np.allclose(sys.C, np.eye(sys.nstates)):
472+
if sys.C.shape[0] != sys.nstates or \
473+
not np.allclose(sys.C, np.eye(sys.nstates)):
473474
raise ValueError("System output must be full state")
474475

475476
# Make sure that the output matches the size of RN

control/sysnorm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ def _h2norm_slycot(sys, print_warning=True):
2929
try:
3030
from slycot import ab13bd
3131
except ImportError:
32-
ct.ControlSlycot("Can't find slycot module `ab13bd`!")
32+
ct.ControlSlycot("Can't find slycot module ab13bd")
3333

3434
try:
3535
from slycot.exceptions import SlycotArithmeticError
3636
except ImportError:
3737
raise ct.ControlSlycot(
38-
"Can't find slycot class `SlycotArithmeticError`!")
38+
"Can't find slycot class SlycotArithmeticError")
3939

4040
A, B, C, D = ct.ssdata(ct.ss(sys))
4141

0 commit comments

Comments
 (0)