From 2d1edb0751edeb12d476dba633d7b8736a4debc10b08a0b9d51f3e60bf60cada Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Mon, 28 Dec 2020 22:15:15 +0000 Subject: [PATCH] Accepting request 859108 from home:bnavigator:branches:devel:languages:python:numeric - Update to version 0.8.4 * Improved default time vector for time response functions (bnavigator, sawyerbfuller) * New use_legacy_defaults function to allow compatibility with previous versions (sawyerbfuller) * Allow creation of non-proper transfer functions (bnavigator, rlegnain) * Added ability to set arrow head length and width option in nyquist_plot (geekonloose) * Added ability to 'prewarp' the conversion of continuous to discrete-time systems (sawyerbfuller) * Added rlocus capability for discrete-time systems (sawyerbfuller) * Updated pzmap grid to be compatible with matplotlib updates (bnavigator) * Implement loadable string representation (repr) for tf, ss, and frd (repagh) * Fixed margin computation for discrete time systems (bnavigator) * Fixed indexing bug in bdalg.connect (sawyerbfuller) * Fixed InterconnectedSystem naming bugs, improved conventions (samlaf) * Fixed LinearIOSystem output bug in output function (francescoseccamonte) * Fixed bug in forced_response that overrode squeeze parameter (bnavigator) * Use rad/sec for Bode plot in MATLAB bode (was erroneously defaulting to Hertz) (paulvicioso) * Removed deprecated scipy calls and updated to latest numpy (bnavigator) * Multiple documentation updates (bnavigator, laurensvalk) * New and improved examples for sisotool, pvtol (repagh, samlaf) * The rlocus function no longer automatically creates a new figure * Updated unit tests + switch to pytest (bnavigator, sawyerbfuller) * Return type for eigenvalues in lqe changed to 1D array (matches lqr) * Small fixes + documentation updates to markov - Remove forbidden arch macros in noarch package - Drop patches merged upstream * pr365-copy-PR-320-for-robust_array_test.patch * pr366-ease-precision-tolerance.patch * pr380-fix-pytest-discovery.patch * pr430-numpy119delete.patch OBS-URL: https://build.opensuse.org/request/show/859108 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-control?expand=0&rev=23 --- control-0.8.3.tar.gz | 3 - control-0.8.4.tar.gz | 3 + pr365-copy-PR-320-for-robust_array_test.patch | 37 ---- pr366-ease-precision-tolerance.patch | 181 ------------------ pr380-fix-pytest-discovery.patch | 25 --- pr430-numpy119delete.patch | 29 --- python-control.changes | 49 +++++ python-control.spec | 26 +-- 8 files changed, 59 insertions(+), 294 deletions(-) delete mode 100644 control-0.8.3.tar.gz create mode 100644 control-0.8.4.tar.gz delete mode 100644 pr365-copy-PR-320-for-robust_array_test.patch delete mode 100644 pr366-ease-precision-tolerance.patch delete mode 100644 pr380-fix-pytest-discovery.patch delete mode 100644 pr430-numpy119delete.patch diff --git a/control-0.8.3.tar.gz b/control-0.8.3.tar.gz deleted file mode 100644 index 3dfbeb8..0000000 --- a/control-0.8.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1fcfdcf39f96523cb1f2cf7bf7b8ae68ec3ef8350e5c55e17e02afdb0872edbb -size 249610 diff --git a/control-0.8.4.tar.gz b/control-0.8.4.tar.gz new file mode 100644 index 0000000..389cc86 --- /dev/null +++ b/control-0.8.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fed8ca6c773175bea14b121c001eee20c48977629a498d9a2d19a85490112ba5 +size 261825 diff --git a/pr365-copy-PR-320-for-robust_array_test.patch b/pr365-copy-PR-320-for-robust_array_test.patch deleted file mode 100644 index 6d0ccb6..0000000 --- a/pr365-copy-PR-320-for-robust_array_test.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b4b3d10c1ab5ef1bbf4d992f045408f6f6e88de7 Mon Sep 17 00:00:00 2001 -From: Benjamin Greiner -Date: Sat, 4 Jan 2020 22:30:42 -0800 -Subject: [PATCH] copy PR 320 for robust_array_test - ---- - control/tests/robust_array_test.py | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/control/tests/robust_array_test.py b/control/tests/robust_array_test.py -index 51114f87..62cf8c6c 100644 ---- a/control/tests/robust_array_test.py -+++ b/control/tests/robust_array_test.py -@@ -261,7 +261,7 @@ def testMimoW3(self): - @unittest.skipIf(not slycot_check(), "slycot not installed") - def testMimoW123(self): - """MIMO plant with all weights""" -- from control import augw, ss, append -+ from control import augw, ss, append, minreal - g = ss([[-1., -2], [-3, -4]], - [[1., 0.], [0., 1.]], - [[1., 0.], [0., 1.]], -@@ -311,10 +311,10 @@ def testMimoW123(self): - self.siso_almost_equal(w2[1, 1], p[3, 3]) - # u->z3 should be w3*g - w3g = w3 * g; -- self.siso_almost_equal(w3g[0, 0], p[4, 2]) -- self.siso_almost_equal(w3g[0, 1], p[4, 3]) -- self.siso_almost_equal(w3g[1, 0], p[5, 2]) -- self.siso_almost_equal(w3g[1, 1], p[5, 3]) -+ self.siso_almost_equal(w3g[0, 0], minreal(p[4, 2])) -+ self.siso_almost_equal(w3g[0, 1], minreal(p[4, 3])) -+ self.siso_almost_equal(w3g[1, 0], minreal(p[5, 2])) -+ self.siso_almost_equal(w3g[1, 1], minreal(p[5, 3])) - # u->v should be -g - self.siso_almost_equal(-g[0, 0], p[6, 2]) - self.siso_almost_equal(-g[0, 1], p[6, 3]) diff --git a/pr366-ease-precision-tolerance.patch b/pr366-ease-precision-tolerance.patch deleted file mode 100644 index b382bd2..0000000 --- a/pr366-ease-precision-tolerance.patch +++ /dev/null @@ -1,181 +0,0 @@ -From f4915eb44c45b17a9ac271e7acec58470243b5fa Mon Sep 17 00:00:00 2001 -From: Benjamin Greiner -Date: Mon, 6 Jan 2020 12:19:56 -0800 -Subject: [PATCH] ease precision tolerenace for iosys tests - ---- - control/tests/iosys_test.py | 42 ++++++++++++++++++------------------- - 1 file changed, 21 insertions(+), 21 deletions(-) - -diff --git a/control/tests/iosys_test.py b/control/tests/iosys_test.py -index aaf2243c..9fdac09c 100644 ---- a/control/tests/iosys_test.py -+++ b/control/tests/iosys_test.py -@@ -60,7 +60,7 @@ def test_linear_iosys(self): - lti_t, lti_y, lti_x = ct.forced_response(linsys, T, U, X0) - ios_t, ios_y = ios.input_output_response(iosys, T, U, X0) - np.testing.assert_array_almost_equal(lti_t, ios_t) -- np.testing.assert_array_almost_equal(lti_y, ios_y, decimal=3) -+ np.testing.assert_allclose(lti_y, ios_y,atol=0.002,rtol=0.) - - @unittest.skipIf(StrictVersion(sp.__version__) < "1.0", - "requires SciPy 1.0 or greater") -@@ -75,7 +75,7 @@ def test_tf2io(self): - lti_t, lti_y, lti_x = ct.forced_response(linsys, T, U, X0) - ios_t, ios_y = ios.input_output_response(iosys, T, U, X0) - np.testing.assert_array_almost_equal(lti_t, ios_t) -- np.testing.assert_array_almost_equal(lti_y, ios_y, decimal=3) -+ np.testing.assert_allclose(lti_y, ios_y,atol=0.002,rtol=0.) - - def test_ss2io(self): - # Create an input/output system from the linear system -@@ -161,7 +161,7 @@ def test_nonlinear_iosys(self): - lti_t, lti_y, lti_x = ct.forced_response(linsys, T, U, X0) - ios_t, ios_y = ios.input_output_response(nlsys, T, U, X0) - np.testing.assert_array_almost_equal(lti_t, ios_t) -- np.testing.assert_array_almost_equal(lti_y, ios_y, decimal=3) -+ np.testing.assert_allclose(lti_y, ios_y,atol=0.002,rtol=0.) - - def test_linearize(self): - # Create a single input/single output linear system -@@ -214,7 +214,7 @@ def test_connect(self): - iosys_series, T, U, X0, return_x=True) - lti_t, lti_y, lti_x = ct.forced_response(linsys_series, T, U, X0) - np.testing.assert_array_almost_equal(lti_t, ios_t) -- np.testing.assert_array_almost_equal(lti_y, ios_y, decimal=3) -+ np.testing.assert_allclose(lti_y, ios_y,atol=0.002,rtol=0.) - - # Connect systems with different timebases - linsys2c = self.siso_linsys -@@ -231,7 +231,7 @@ def test_connect(self): - iosys_series, T, U, X0, return_x=True) - lti_t, lti_y, lti_x = ct.forced_response(linsys_series, T, U, X0) - np.testing.assert_array_almost_equal(lti_t, ios_t) -- np.testing.assert_array_almost_equal(lti_y, ios_y, decimal=3) -+ np.testing.assert_allclose(lti_y, ios_y,atol=0.002,rtol=0.) - - # Feedback interconnection - linsys_feedback = ct.feedback(linsys1, linsys2) -@@ -246,7 +246,7 @@ def test_connect(self): - iosys_feedback, T, U, X0, return_x=True) - lti_t, lti_y, lti_x = ct.forced_response(linsys_feedback, T, U, X0) - np.testing.assert_array_almost_equal(lti_t, ios_t) -- np.testing.assert_array_almost_equal(lti_y, ios_y, decimal=3) -+ np.testing.assert_allclose(lti_y, ios_y,atol=0.002,rtol=0.) - - @unittest.skipIf(StrictVersion(sp.__version__) < "1.0", - "requires SciPy 1.0 or greater") -@@ -357,7 +357,7 @@ def test_summer(self): - - lin_t, lin_y, lin_x = ct.forced_response(linsys_parallel, T, U, X0) - ios_t, ios_y = ios.input_output_response(iosys_parallel, T, U, X0) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - @unittest.skipIf(StrictVersion(sp.__version__) < "1.0", - "requires SciPy 1.0 or greater") -@@ -420,7 +420,7 @@ def test_feedback(self): - - ios_t, ios_y = ios.input_output_response(iosys, T, U, X0) - lti_t, lti_y, lti_x = ct.forced_response(linsys, T, U, X0) -- np.testing.assert_array_almost_equal(ios_y, lti_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lti_y,atol=0.002,rtol=0.) - - @unittest.skipIf(StrictVersion(sp.__version__) < "1.0", - "requires SciPy 1.0 or greater") -@@ -442,7 +442,7 @@ def test_bdalg_functions(self): - iosys_series = ct.series(linio1, linio2) - lin_t, lin_y, lin_x = ct.forced_response(linsys_series, T, U, X0) - ios_t, ios_y = ios.input_output_response(iosys_series, T, U, X0) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - # Make sure that systems don't commute - linsys_series = ct.series(linsys2, linsys1) -@@ -454,21 +454,21 @@ def test_bdalg_functions(self): - iosys_parallel = ct.parallel(linio1, linio2) - lin_t, lin_y, lin_x = ct.forced_response(linsys_parallel, T, U, X0) - ios_t, ios_y = ios.input_output_response(iosys_parallel, T, U, X0) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - # Negation - linsys_negate = ct.negate(linsys1) - iosys_negate = ct.negate(linio1) - lin_t, lin_y, lin_x = ct.forced_response(linsys_negate, T, U, X0) - ios_t, ios_y = ios.input_output_response(iosys_negate, T, U, X0) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - # Feedback interconnection - linsys_feedback = ct.feedback(linsys1, linsys2) - iosys_feedback = ct.feedback(linio1, linio2) - lin_t, lin_y, lin_x = ct.forced_response(linsys_feedback, T, U, X0) - ios_t, ios_y = ios.input_output_response(iosys_feedback, T, U, X0) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - @unittest.skipIf(StrictVersion(sp.__version__) < "1.0", - "requires SciPy 1.0 or greater") -@@ -496,26 +496,26 @@ def test_nonsquare_bdalg(self): - iosys_multiply = iosys_3i2o * iosys_2i3o - lin_t, lin_y, lin_x = ct.forced_response(linsys_multiply, T, U2, X0) - ios_t, ios_y = ios.input_output_response(iosys_multiply, T, U2, X0) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - linsys_multiply = linsys_2i3o * linsys_3i2o - iosys_multiply = iosys_2i3o * iosys_3i2o - lin_t, lin_y, lin_x = ct.forced_response(linsys_multiply, T, U3, X0) - ios_t, ios_y = ios.input_output_response(iosys_multiply, T, U3, X0) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - # Right multiplication - # TODO: add real tests once conversion from other types is supported - iosys_multiply = ios.InputOutputSystem.__rmul__(iosys_3i2o, iosys_2i3o) - ios_t, ios_y = ios.input_output_response(iosys_multiply, T, U3, X0) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - # Feedback - linsys_multiply = ct.feedback(linsys_3i2o, linsys_2i3o) - iosys_multiply = iosys_3i2o.feedback(iosys_2i3o) - lin_t, lin_y, lin_x = ct.forced_response(linsys_multiply, T, U3, X0) - ios_t, ios_y = ios.input_output_response(iosys_multiply, T, U3, X0) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - # Mismatch should generate exception - args = (iosys_3i2o, iosys_3i2o) -@@ -536,8 +536,8 @@ def test_discrete(self): - # Simulate and compare to LTI output - ios_t, ios_y = ios.input_output_response(lnios, T, U, X0) - lin_t, lin_y, lin_x = ct.forced_response(linsys, T, U, X0) -- np.testing.assert_array_almost_equal(ios_t, lin_t, decimal=3) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_t, lin_t,atol=0.002,rtol=0.) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - # Test MIMO system, converted to discrete time - linsys = ct.StateSpace(self.mimo_linsys1) -@@ -552,8 +552,8 @@ def test_discrete(self): - # Simulate and compare to LTI output - ios_t, ios_y = ios.input_output_response(lnios, T, U, X0) - lin_t, lin_y, lin_x = ct.forced_response(linsys, T, U, X0) -- np.testing.assert_array_almost_equal(ios_t, lin_t, decimal=3) -- np.testing.assert_array_almost_equal(ios_y, lin_y, decimal=3) -+ np.testing.assert_allclose(ios_t, lin_t,atol=0.002,rtol=0.) -+ np.testing.assert_allclose(ios_y, lin_y,atol=0.002,rtol=0.) - - def test_find_eqpts(self): - """Test find_eqpt function""" -@@ -738,7 +738,7 @@ def test_params(self): - - # Check to make sure results are OK - np.testing.assert_array_almost_equal(lti_t, ios_t) -- np.testing.assert_array_almost_equal(lti_y, ios_y, decimal=3) -+ np.testing.assert_allclose(lti_y, ios_y,atol=0.002,rtol=0.) - - def test_named_signals(self): - sys1 = ios.NonlinearIOSystem( diff --git a/pr380-fix-pytest-discovery.patch b/pr380-fix-pytest-discovery.patch deleted file mode 100644 index 17c2f6b..0000000 --- a/pr380-fix-pytest-discovery.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/control/tests/discrete_test.py b/control/tests/discrete_test.py -index f08a5fa5..6598e3a8 100644 ---- a/control/tests/discrete_test.py -+++ b/control/tests/discrete_test.py -@@ -5,7 +5,9 @@ - - import unittest - import numpy as np --from control import * -+from control import StateSpace, TransferFunction, feedback, step_response, \ -+ isdtime, timebase, isctime, sample_system, bode, impulse_response, \ -+ timebaseEqual, forced_response - from control import matlab - - class TestDiscrete(unittest.TestCase): -@@ -382,9 +384,6 @@ def test_discrete_bode(self): - np.testing.assert_array_almost_equal(mag_out, np.absolute(H_z)) - np.testing.assert_array_almost_equal(phase_out, np.angle(H_z)) - --def suite(): -- return unittest.TestLoader().loadTestsFromTestCase(TestDiscrete) -- - - if __name__ == "__main__": - unittest.main() diff --git a/pr430-numpy119delete.patch b/pr430-numpy119delete.patch deleted file mode 100644 index 904018d..0000000 --- a/pr430-numpy119delete.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 1c91dce12d054b0edf095172970cf64e9d9e7f6a Mon Sep 17 00:00:00 2001 -From: bnavigator -Date: Thu, 9 Jul 2020 20:10:04 +0200 -Subject: [PATCH] only call np.delete with actual removal - ---- - control/iosys.py | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/control/iosys.py b/control/iosys.py -index 908f407..e2bdb29 100644 ---- a/control/iosys.py -+++ b/control/iosys.py -@@ -1643,8 +1643,10 @@ def find_eqpt(sys, x0, u0=[], y0=None, t=0, params={}, - # and were processed above. - - # Get the states and inputs that were not listed as fixed -- state_vars = np.delete(np.array(range(nstates)), ix) -- input_vars = np.delete(np.array(range(ninputs)), iu) -+ state_vars = (range(nstates) if not len(ix) -+ else np.delete(np.array(range(nstates)), ix)) -+ input_vars = (range(ninputs) if not len(iu) -+ else np.delete(np.array(range(ninputs)), iu)) - - # Set the outputs and derivs that will serve as constraints - output_vars = np.array(iy) --- -2.27.0 - diff --git a/python-control.changes b/python-control.changes index 5fe595e..bbfc31d 100644 --- a/python-control.changes +++ b/python-control.changes @@ -1,3 +1,52 @@ +------------------------------------------------------------------- +Mon Dec 28 20:31:00 UTC 2020 - Benjamin Greiner + +- Update to version 0.8.4 + * Improved default time vector for time response + functions (bnavigator, sawyerbfuller) + * New use_legacy_defaults function to allow compatibility + with previous versions (sawyerbfuller) + * Allow creation of non-proper transfer functions + (bnavigator, rlegnain) + * Added ability to set arrow head length and width option + in nyquist_plot (geekonloose) + * Added ability to 'prewarp' the conversion of continuous to + discrete-time systems (sawyerbfuller) + * Added rlocus capability for discrete-time systems + (sawyerbfuller) + * Updated pzmap grid to be compatible with matplotlib updates + (bnavigator) + * Implement loadable string representation (repr) for tf, ss, + and frd (repagh) + * Fixed margin computation for discrete time systems + (bnavigator) + * Fixed indexing bug in bdalg.connect (sawyerbfuller) + * Fixed InterconnectedSystem naming bugs, improved + conventions (samlaf) + * Fixed LinearIOSystem output bug in output function + (francescoseccamonte) + * Fixed bug in forced_response that overrode squeeze + parameter (bnavigator) + * Use rad/sec for Bode plot in MATLAB bode (was erroneously + defaulting to Hertz) (paulvicioso) + * Removed deprecated scipy calls and updated to latest numpy + (bnavigator) + * Multiple documentation updates (bnavigator, laurensvalk) + * New and improved examples for sisotool, pvtol (repagh, samlaf) + * The rlocus function no longer automatically creates a new + figure + * Updated unit tests + switch to pytest (bnavigator, + sawyerbfuller) + * Return type for eigenvalues in lqe changed to 1D array + (matches lqr) + * Small fixes + documentation updates to markov +- Remove forbidden arch macros in noarch package +- Drop patches merged upstream + * pr365-copy-PR-320-for-robust_array_test.patch + * pr366-ease-precision-tolerance.patch + * pr380-fix-pytest-discovery.patch + * pr430-numpy119delete.patch + ------------------------------------------------------------------- Sun Oct 11 18:39:38 UTC 2020 - Benjamin Greiner diff --git a/python-control.spec b/python-control.spec index 3071f8e..393d878 100644 --- a/python-control.spec +++ b/python-control.spec @@ -19,17 +19,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-control -Version: 0.8.3 +Version: 0.8.4 Release: 0 Summary: Python control systems library License: BSD-3-Clause URL: http://python-control.sourceforge.net Source: https://files.pythonhosted.org/packages/source/c/control/control-%{version}.tar.gz Source1: %{name}-rpmlintrc -Patch0: pr365-copy-PR-320-for-robust_array_test.patch -Patch1: pr366-ease-precision-tolerance.patch -Patch2: pr380-fix-pytest-discovery.patch -Patch3: pr430-numpy119delete.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -46,9 +42,7 @@ BuildRequires: %{python_module pytest-xvfb} BuildRequires: %{python_module pytest} BuildRequires: %{python_module scipy} BuildRequires: %{python_module slycot} -%ifarch %ix86 BuildRequires: libjemalloc2 -%endif # /SECTION %python_subpackages @@ -60,7 +54,7 @@ operations for analysis and design of feedback control systems. %setup -q -n control-%{version} %autopatch -p1 #remove shebang -sed -i '1{\@^#!/usr/bin/env python@ d}' control/tests/*.py +sed -i '1{\@^#!/usr/bin/env@ d}' control/tests/*.py %build %python_build @@ -73,19 +67,13 @@ sed -i '1{\@^#!/usr/bin/env python@ d}' control/tests/*.py # The default Agg backend does not define the toolbar attribute in the Figure # Manager used by some tests, so we run the tests with the Qt5 backend export MPLBACKEND="Qt5Agg" -%if %{_arch} == i386 - # preload malloc library to avoid free() error on i586 architecture - export LD_PRELOAD="%{_libdir}/libjemalloc.so.2" -%endif -cat >> setup.cfg <