Skip to content

Commit f566656

Browse files
committed
fix unit test issue (change in error message)
1 parent 8297a28 commit f566656

7 files changed

Lines changed: 23 additions & 22 deletions

File tree

control/mateqn.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ def lyap(A, Q, C=None, E=None, method=None):
108108
method = _slycot_or_scipy(method)
109109
if method == 'slycot':
110110
if sb03md is None:
111-
raise ControlSlycot("Can't find Slycot module 'sb03md'")
111+
raise ControlSlycot("Can't find slycot module 'sb03md'")
112112
if sb04md is None:
113-
raise ControlSlycot("Can't find Slycot module 'sb04md'")
113+
raise ControlSlycot("Can't find slycot module 'sb04md'")
114114

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

172172
except ImportError:
173-
raise ControlSlycot("Can't find Slycot module 'sg03ad'")
173+
raise ControlSlycot("Can't find slycot module 'sg03ad'")
174174

175175
# Solve the generalized Lyapunov equation by calling Slycot
176176
# function sg03ad
@@ -236,11 +236,11 @@ def dlyap(A, Q, C=None, E=None, method=None):
236236
if method == 'slycot':
237237
# Make sure we have access to the right slycot routines
238238
if sb03md is None:
239-
raise ControlSlycot("Can't find Slycot module 'sb03md'")
239+
raise ControlSlycot("Can't find slycot module 'sb03md'")
240240
if sb04qd is None:
241-
raise ControlSlycot("Can't find Slycot module 'sb04qd'")
241+
raise ControlSlycot("Can't find slycot module 'sb04qd'")
242242
if sg03ad is None:
243-
raise ControlSlycot("Can't find Slycot module 'sg03ad'")
243+
raise ControlSlycot("Can't find slycot module 'sg03ad'")
244244

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

408408
try:
409409
from slycot import sb02mt
410410
except ImportError:
411-
raise ControlSlycot("Can't find Slycot module 'sb02mt'")
411+
raise ControlSlycot("Can't find slycot module 'sb02mt'")
412412

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

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

573573
# Initialize optional matrices
574574
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
@@ -34,7 +34,7 @@ def h2syn(P, nmeas, ncon):
3434
Raises
3535
------
3636
ImportError
37-
If Slycot routine sb10hd is not loaded.
37+
If slycot routine sb10hd is not loaded.
3838
3939
See Also
4040
--------

control/statefbk.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def place_varga(A, B, p, dtime=False, alpha=None):
163163
try:
164164
from slycot import sb01bd
165165
except ImportError:
166-
raise ControlSlycot("can't find slycot module 'sb01bd'")
166+
raise ControlSlycot("can't find slycot module sb01bd")
167167

168168
# Convert the system inputs to NumPy arrays
169169
A_mat = _ssmatrix(A, square=True, name="A")
@@ -1181,7 +1181,7 @@ def gram(sys, type):
11811181
# Compute Gramian by the Slycot routine sb03md
11821182
# make sure Slycot is installed
11831183
if sb03md is None:
1184-
raise ControlSlycot("can't find slycot module 'sb03md'")
1184+
raise ControlSlycot("can't find slycot module sb03md")
11851185
if type == 'c':
11861186
tra = 'T'
11871187
C = -sys.B @ sys.B.T
@@ -1199,7 +1199,7 @@ def gram(sys, type):
11991199
elif type == 'cf' or type == 'of':
12001200
# Compute Cholesky factored Gramian from Slycot routine sb03od
12011201
if sb03od is None:
1202-
raise ControlSlycot("can't find slycot module 'sb03od'")
1202+
raise ControlSlycot("can't find slycot module sb03od")
12031203
tra = 'N'
12041204
n = sys.nstates
12051205
Q = np.zeros((n, n))

control/statesp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ def minreal(self, tol=0.0):
11821182
return StateSpace(A[:nr, :nr], B[:nr, :self.ninputs],
11831183
C[:self.noutputs, :nr], self.D, self.dt)
11841184
except ImportError:
1185-
raise TypeError("minreal requires Slycot tb01pd")
1185+
raise TypeError("minreal requires slycot tb01pd")
11861186
else:
11871187
return StateSpace(self)
11881188

@@ -2004,7 +2004,7 @@ def linfnorm(sys, tol=1e-10):
20042004
20052005
"""
20062006
if ab13dd is None:
2007-
raise ControlSlycot("Can't find slycot module 'ab13dd'")
2007+
raise ControlSlycot("Can't find slycot module ab13dd")
20082008

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

control/stochsys.py

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

478479
# 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
@@ -28,13 +28,13 @@ def _h2norm_slycot(sys, print_warning=True):
2828
try:
2929
from slycot import ab13bd
3030
except ImportError:
31-
ct.ControlSlycot("Can't find slycot module `ab13bd`!")
31+
ct.ControlSlycot("Can't find slycot module ab13bd")
3232

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

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

0 commit comments

Comments
 (0)