diff --git a/control/modelsimp.py b/control/modelsimp.py index 8f6124481..ec015c16b 100644 --- a/control/modelsimp.py +++ b/control/modelsimp.py @@ -395,7 +395,7 @@ def era(YY, m, n, nin, nout, r): raise NotImplementedError('This function is not implemented yet.') -def markov(Y, U, m=None, transpose=None): +def markov(Y, U, m=None, transpose=False): """Calculate the first `m` Markov parameters [D CB CAB ...] from input `U`, output `Y`. @@ -424,8 +424,7 @@ def markov(Y, U, m=None, transpose=None): Number of Markov parameters to output. Defaults to len(U). transpose : bool, optional Assume that input data is transposed relative to the standard - :ref:`time-series-convention`. The default value is true for - backward compatibility with legacy code. + :ref:`time-series-convention`. Default value is False. Returns ------- @@ -456,15 +455,6 @@ def markov(Y, U, m=None, transpose=None): >>> H = markov(Y, U, 3, transpose=False) """ - # Check on the specified format of the input - if transpose is None: - # For backwards compatibility, assume time series in rows but warn user - warnings.warn( - "Time-series data assumed to be in rows. This will change in a " - "future release. Use `transpose=True` to preserve current " - "behavior.") - transpose = True - # Convert input parameters to 2D arrays (if they aren't already) Umat = np.array(U, ndmin=2) Ymat = np.array(Y, ndmin=2) diff --git a/control/tests/modelsimp_test.py b/control/tests/modelsimp_test.py index 1e06cb4b7..4def0b4d7 100644 --- a/control/tests/modelsimp_test.py +++ b/control/tests/modelsimp_test.py @@ -44,13 +44,9 @@ def testMarkovSignature(self, matarrayout, matarrayin): H = markov(np.transpose(Y), np.transpose(U), m, transpose=True) np.testing.assert_array_almost_equal(H, np.transpose(Htrue)) - # Default (in v0.8.4 and below) should be transpose=True (w/ warning) - with pytest.warns(UserWarning, match="assumed to be in rows.*" - "change in a future release"): - # Generate Markov parameters without any arguments - H = markov(np.transpose(Y), np.transpose(U), m) - np.testing.assert_array_almost_equal(H, np.transpose(Htrue)) - + # Generate Markov parameters without any arguments + H = markov(Y, U, m) + np.testing.assert_array_almost_equal(H, Htrue) # Test example from docstring T = np.linspace(0, 10, 100) @@ -65,9 +61,8 @@ def testMarkovSignature(self, matarrayout, matarrayin): # Make sure MIMO generates an error U = np.ones((2, 100)) # 2 inputs (Y unchanged, with 1 output) - with pytest.warns(UserWarning): - with pytest.raises(ControlMIMONotImplemented): - markov(Y, U, m) + with pytest.raises(ControlMIMONotImplemented): + markov(Y, U, m) # Make sure markov() returns the right answer @pytest.mark.parametrize("k, m, n", @@ -108,7 +103,7 @@ def testMarkovResults(self, k, m, n): T = np.array(range(n)) * Ts U = np.cos(T) + np.sin(T/np.pi) _, Y, _ = forced_response(Hd, T, U, squeeze=True) - Mcomp = markov(Y, U, m, transpose=False) + Mcomp = markov(Y, U, m) # Compare to results from markov() np.testing.assert_array_almost_equal(Mtrue, Mcomp)
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: