We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2a799e9 + f591c08 commit 2746ce1Copy full SHA for 2746ce1
5 files changed
control/iosys.py
@@ -366,8 +366,8 @@ def _rhs(self, t, x, u):
366
you may want to use :meth:`dynamics`.
367
368
"""
369
- NotImplemented("Evaluation not implemented for system of type ",
370
- type(self))
+ raise NotImplementedError("Evaluation not implemented for system of type ",
+ type(self))
371
372
def dynamics(self, t, x, u, params=None):
373
"""Compute the dynamics of a differential or difference equation.
control/modelsimp.py
@@ -476,7 +476,7 @@ def markov(Y, U, m=None, transpose=False):
476
477
# Make sure there is enough data to compute parameters
478
if m > n:
479
- warn.warning("Not enough data for requested number of parameters")
+ warnings.warn("Not enough data for requested number of parameters")
480
481
#
482
# Original algorithm (with mapping to standard order)
control/optimal.py
@@ -20,8 +20,6 @@
20
from .exception import ControlNotImplemented
21
from .timeresp import TimeResponseData
22
23
-__all__ = ['find_optimal_input']
24
-
25
# Define module default parameter values
26
_optimal_defaults = {
27
'optimal.minimize_method': None,
control/statesp.py
@@ -59,6 +59,8 @@
59
from scipy.signal import cont2discrete
60
from scipy.signal import StateSpace as signalStateSpace
61
from warnings import warn
62
+
63
+from .exception import ControlSlycot
64
from .frdata import FrequencyResponseData
65
from .lti import LTI, _process_frequency_response
66
from .namedio import common_timebase, isdtime
control/tests/optimal_test.py
@@ -381,17 +381,8 @@ def test_optimal_logging(capsys):
381
@pytest.mark.parametrize("fun, args, exception, match", [
382
[opt.quadratic_cost, (np.zeros((2, 3)), np.eye(2)), ValueError,
383
"Q matrix is the wrong shape"],
384
- [opt.quadratic_cost, (np.eye(2), 1), ValueError,
+ [opt.quadratic_cost, (np.eye(2), np.eye(2, 3)), ValueError,
385
"R matrix is the wrong shape"],
386
-])
387
-def test_constraint_constructor_errors(fun, args, exception, match):
388
- """Test various error conditions for constraint constructors"""
389
- sys = ct.ss2io(ct.rss(2, 2, 2))
390
- with pytest.raises(exception, match=match):
391
- fun(sys, *args)
392
393
394
-@pytest.mark.parametrize("fun, args, exception, match", [
395
[opt.input_poly_constraint, (np.zeros((2, 3)), [0, 0]), ValueError,
396
"polytope matrix must match number of inputs"],
397
[opt.output_poly_constraint, (np.zeros((2, 3)), [0, 0]), ValueError,
0 commit comments