From 7288a3d019ce336c4bb62c574f5a4cef435255baa0993711159cb2f3bba6bc53 Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Sat, 31 Dec 2022 22:05:03 +0000 Subject: [PATCH] Accepting request 1045948 from home:bnavigator:branches:devel:languages:python:numeric - Update to 0.9.3.post2 * Improvements in optimal and flatsys modules, updated passivity module, gain scheduling support, bug fixes * Handle t_eval for static systems in input_output_response by @murrayrm in #743 * add GitHub URL for PyPi by @andriyor in #708 * Remove Deprecated API calls to Pytest, SciPy <1.3, Python 2 by @bnavigator in #745 * Add passivity module, ispassive function, and passivity_test. Introduces optional dependency cvxopt. by @Mark-Yeatman in #739 * Slycot source uses setuptools_scm now by @bnavigator in #751 * Passivity indices and support for discrete time systems. by @Mark-Yeatman in #750 * Switch CI to mambaforge and conda-forge channel by @bnavigator in #757 * Fix timebase bug in InterconnectedSystem (issue #754) by @murrayrm in #755 * fix issue with slycot balred change in state by @bnavigator in #762 * Build system and test suite update by @bnavigator in #759 * fix control.matlab.lsim bug for discrete time system by @murrayrm in #765 * Add B-splines and solve_flat_ocp to flatsys by @murrayrm in #763 * CI: switch slycot and cvxopt installation order by @murrayrm in #769 * Fixed a couple of typos in documentation by @fredrhen in #775 * Allow new matplotlib 3.6 error message in kwargs tests by @bnavigator in #777 * Move sys._update_params(params) before TimeResponseData return OBS-URL: https://build.opensuse.org/request/show/1045948 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-control?expand=0&rev=38 --- control-0.9.2.tar.gz | 3 - control-0.9.3.post2.tar.gz | 3 + control-pr777-mpl36.patch | 160 ------------------------------------- python-control.changes | 79 ++++++++++++++++++ python-control.spec | 14 ++-- 5 files changed, 89 insertions(+), 170 deletions(-) delete mode 100644 control-0.9.2.tar.gz create mode 100644 control-0.9.3.post2.tar.gz delete mode 100644 control-pr777-mpl36.patch diff --git a/control-0.9.2.tar.gz b/control-0.9.2.tar.gz deleted file mode 100644 index 8c84774..0000000 --- a/control-0.9.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0891d2d32d6006ac1faa4e238ed8223ca342a4721d202dfeccae24fb02563183 -size 398165 diff --git a/control-0.9.3.post2.tar.gz b/control-0.9.3.post2.tar.gz new file mode 100644 index 0000000..aecc3f2 --- /dev/null +++ b/control-0.9.3.post2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ced64f2faa5e0baa2184074ac8239f638218dccfa00c89165e0466d9ef8f161 +size 3912196 diff --git a/control-pr777-mpl36.patch b/control-pr777-mpl36.patch deleted file mode 100644 index 535c17b..0000000 --- a/control-pr777-mpl36.patch +++ /dev/null @@ -1,160 +0,0 @@ -From dc74aec940d027a1857eb1a97ca3e6a3a7c0a3b1 Mon Sep 17 00:00:00 2001 -From: Ben Greiner -Date: Sat, 8 Oct 2022 16:01:15 +0200 -Subject: [PATCH 1/2] parametrize kwargs tests; allow new matplotib 3.6 error - message - ---- - control/tests/kwargs_test.py | 135 +++++++++++++++++------------------ - 1 file changed, 65 insertions(+), 70 deletions(-) - -diff --git a/control/tests/kwargs_test.py b/control/tests/kwargs_test.py -index 598a8ccca..855bb9dda 100644 ---- a/control/tests/kwargs_test.py -+++ b/control/tests/kwargs_test.py -@@ -75,79 +75,74 @@ def test_kwarg_search(module, prefix): - test_kwarg_search(obj, prefix + obj.__name__ + '.') - - --@pytest.mark.usefixtures('editsdefaults') --def test_unrecognized_kwargs(): -+@pytest.mark.parametrize( -+ "function, nsssys, ntfsys, moreargs, kwargs", -+ [(control.dlqe, 1, 0, ([[1]], [[1]]), {}), -+ (control.dlqr, 1, 0, ([[1, 0], [0, 1]], [[1]]), {}), -+ (control.drss, 0, 0, (2, 1, 1), {}), -+ (control.input_output_response, 1, 0, ([0, 1, 2], [1, 1, 1]), {}), -+ (control.lqe, 1, 0, ([[1]], [[1]]), {}), -+ (control.lqr, 1, 0, ([[1, 0], [0, 1]], [[1]]), {}), -+ (control.linearize, 1, 0, (0, 0), {}), -+ (control.pzmap, 1, 0, (), {}), -+ (control.rlocus, 0, 1, ( ), {}), -+ (control.root_locus, 0, 1, ( ), {}), -+ (control.rss, 0, 0, (2, 1, 1), {}), -+ (control.set_defaults, 0, 0, ('control',), {'default_dt': True}), -+ (control.ss, 0, 0, (0, 0, 0, 0), {'dt': 1}), -+ (control.ss2io, 1, 0, (), {}), -+ (control.ss2tf, 1, 0, (), {}), -+ (control.summing_junction, 0, 0, (2,), {}), -+ (control.tf, 0, 0, ([1], [1, 1]), {}), -+ (control.tf2io, 0, 1, (), {}), -+ (control.tf2ss, 0, 1, (), {}), -+ (control.InputOutputSystem, 0, 0, (), -+ {'inputs': 1, 'outputs': 1, 'states': 1}), -+ (control.InputOutputSystem.linearize, 1, 0, (0, 0), {}), -+ (control.StateSpace, 0, 0, ([[-1, 0], [0, -1]], [[1], [1]], [[1, 1]], 0), {}), -+ (control.TransferFunction, 0, 0, ([1], [1, 1]), {})] -+) -+def test_unrecognized_kwargs(function, nsssys, ntfsys, moreargs, kwargs, -+ mplcleanup, editsdefaults): -+ # Create SISO systems for use in parameterized tests -+ sssys = control.ss([[-1, 1], [0, -1]], [[0], [1]], [[1, 0]], 0, dt=None) -+ tfsys = control.tf([1], [1, 1]) -+ -+ args = (sssys, )*nsssys + (tfsys, )*ntfsys + moreargs -+ -+ # Call the function normally and make sure it works -+ function(*args, **kwargs) -+ -+ # Now add an unrecognized keyword and make sure there is an error -+ with pytest.raises(TypeError, match="unrecognized keyword"): -+ function(*args, **kwargs, unknown=None) -+ -+ -+@pytest.mark.parametrize( -+ "function, nsysargs, moreargs, kwargs", -+ [(control.bode, 1, (), {}), -+ (control.bode_plot, 1, (), {}), -+ (control.describing_function_plot, 1, -+ (control.descfcn.saturation_nonlinearity(1), [1, 2, 3, 4]), {}), -+ (control.gangof4, 2, (), {}), -+ (control.gangof4_plot, 2, (), {}), -+ (control.nyquist, 1, (), {}), -+ (control.nyquist_plot, 1, (), {}), -+ (control.singular_values_plot, 1, (), {})] -+) -+def test_matplotlib_kwargs(function, nsysargs, moreargs, kwargs, mplcleanup): - # Create a SISO system for use in parameterized tests - sys = control.ss([[-1, 1], [0, -1]], [[0], [1]], [[1, 0]], 0, dt=None) - -- table = [ -- [control.dlqe, (sys, [[1]], [[1]]), {}], -- [control.dlqr, (sys, [[1, 0], [0, 1]], [[1]]), {}], -- [control.drss, (2, 1, 1), {}], -- [control.input_output_response, (sys, [0, 1, 2], [1, 1, 1]), {}], -- [control.lqe, (sys, [[1]], [[1]]), {}], -- [control.lqr, (sys, [[1, 0], [0, 1]], [[1]]), {}], -- [control.linearize, (sys, 0, 0), {}], -- [control.pzmap, (sys,), {}], -- [control.rlocus, (control.tf([1], [1, 1]), ), {}], -- [control.root_locus, (control.tf([1], [1, 1]), ), {}], -- [control.rss, (2, 1, 1), {}], -- [control.set_defaults, ('control',), {'default_dt': True}], -- [control.ss, (0, 0, 0, 0), {'dt': 1}], -- [control.ss2io, (sys,), {}], -- [control.ss2tf, (sys,), {}], -- [control.summing_junction, (2,), {}], -- [control.tf, ([1], [1, 1]), {}], -- [control.tf2io, (control.tf([1], [1, 1]),), {}], -- [control.tf2ss, (control.tf([1], [1, 1]),), {}], -- [control.InputOutputSystem, (), -- {'inputs': 1, 'outputs': 1, 'states': 1}], -- [control.InputOutputSystem.linearize, (sys, 0, 0), {}], -- [control.StateSpace, ([[-1, 0], [0, -1]], [[1], [1]], [[1, 1]], 0), {}], -- [control.TransferFunction, ([1], [1, 1]), {}], -- ] -- -- for function, args, kwargs in table: -- # Call the function normally and make sure it works -- function(*args, **kwargs) -- -- # Now add an unrecognized keyword and make sure there is an error -- with pytest.raises(TypeError, match="unrecognized keyword"): -- function(*args, **kwargs, unknown=None) -- -- # If we opened any figures, close them to avoid matplotlib warnings -- if plt.gca(): -- plt.close('all') -- -- --def test_matplotlib_kwargs(): -- # Create a SISO system for use in parameterized tests -- sys = control.ss([[-1, 1], [0, -1]], [[0], [1]], [[1, 0]], 0, dt=None) -- ctl = control.ss([[-1, 1], [0, -1]], [[0], [1]], [[1, 0]], 0, dt=None) -- -- table = [ -- [control.bode, (sys, ), {}], -- [control.bode_plot, (sys, ), {}], -- [control.describing_function_plot, -- (sys, control.descfcn.saturation_nonlinearity(1), [1, 2, 3, 4]), {}], -- [control.gangof4, (sys, ctl), {}], -- [control.gangof4_plot, (sys, ctl), {}], -- [control.nyquist, (sys, ), {}], -- [control.nyquist_plot, (sys, ), {}], -- [control.singular_values_plot, (sys, ), {}], -- ] -- -- for function, args, kwargs in table: -- # Call the function normally and make sure it works -- function(*args, **kwargs) -- -- # Now add an unrecognized keyword and make sure there is an error -- with pytest.raises(AttributeError, match="has no property"): -- function(*args, **kwargs, unknown=None) -- -- # If we opened any figures, close them to avoid matplotlib warnings -- if plt.gca(): -- plt.close('all') -+ # Call the function normally and make sure it works -+ args = (sys, )*nsysargs + moreargs -+ function(*args, **kwargs) -+ -+ # Now add an unrecognized keyword and make sure there is an error -+ with pytest.raises(AttributeError, -+ match="(has no property|unexpected keyword)"): -+ function(*args, **kwargs, unknown=None) -+ - - - # - diff --git a/python-control.changes b/python-control.changes index 4b7ccbb..beab255 100644 --- a/python-control.changes +++ b/python-control.changes @@ -1,3 +1,82 @@ +------------------------------------------------------------------- +Sat Dec 31 19:48:37 UTC 2022 - Ben Greiner + +- Update to 0.9.3.post2 + * Improvements in optimal and flatsys modules, updated passivity + module, gain scheduling support, bug fixes + * Handle t_eval for static systems in input_output_response by + @murrayrm in #743 + * add GitHub URL for PyPi by @andriyor in #708 + * Remove Deprecated API calls to Pytest, SciPy <1.3, Python 2 by + @bnavigator in #745 + * Add passivity module, ispassive function, and passivity_test. + Introduces optional dependency cvxopt. by @Mark-Yeatman in #739 + * Slycot source uses setuptools_scm now by @bnavigator in #751 + * Passivity indices and support for discrete time systems. by + @Mark-Yeatman in #750 + * Switch CI to mambaforge and conda-forge channel by @bnavigator + in #757 + * Fix timebase bug in InterconnectedSystem (issue #754) by + @murrayrm in #755 + * fix issue with slycot balred change in state by @bnavigator in + #762 + * Build system and test suite update by @bnavigator in #759 + * fix control.matlab.lsim bug for discrete time system by + @murrayrm in #765 + * Add B-splines and solve_flat_ocp to flatsys by @murrayrm in + #763 + * CI: switch slycot and cvxopt installation order by @murrayrm in + #769 + * Fixed a couple of typos in documentation by @fredrhen in #775 + * Allow new matplotlib 3.6 error message in kwargs tests by + @bnavigator in #777 + * Move sys._update_params(params) before TimeResponseData return + when nstate == 0 by @hyumo in #774 + * Update MANIFEST.in by @bnavigator in #779 + * Improve compatibility of state space representation using LaTeX + by @gonmolina in #780 + * Fix interconnect type conversion bug for StateSpace systems by + @murrayrm in #788 + * fix _isstatic() to use nstates==0 by @murrayrm in #790 + * fix error when an IOSystem is combined with a TransferFunction + system by @sawyerbfuller in #793 + * check for and fix mutable keyword defaults by @murrayrm in #794 + * Fixes for bugs found by pylint by @roryyorke in #795 + * Support Python 3.11 and drop Python 3.7 by @bnavigator in #796 + * Fix find_eqpt when y0 is None by @adswid in #798 + * Preserve signal names upon conversion to discrete-time by + @sawyerbfuller in #797 + * Update benchmarks to help with optimal control tuning by + @murrayrm in #800 + * Update optimal.rst by @htadashi in #802 + * Add collocation method for optimal control problems by + @murrayrm in #799 + * Update README.rst by @sawyerbfuller in #810 + * Update docstring for impulse for discrete sys by @sawyerbfuller + in #812 + * Enable scalar division of state-space objects by @roryyorke in + #811 + * fix gain handling in rlocus and sisotool by @sawyerbfuller in + #809 + * Removed epsilon perturbation value in solve_passivity_LMI. Fix + associated unit test. by @Mark-Yeatman in #814 + * docstring improvements by @sawyerbfuller in #804 + * add zpk() function by @murrayrm in #816 + * Fix readthedocs to use pip-based install by @murrayrm in #817 + * Relax comparison of floats in tests by @bnavigator in #818 + * Add test matrix against operating environments by @murrayrm in + #821 + * Update find_eqpts to handle discrete time systems by @murrayrm + in #824 + * Small fixes and tweaks by @murrayrm in #826 + * update docs to use use numpydoc + linkcode by @murrayrm in #828 + * Add gain scheduling to create_statefbk_iosystem() by @murrayrm + in #827 + * continuous time system support for create_estimator_iosystem by + @murrayrm in #829 + * Small docstring fixes for release by @murrayrm in #832 +- Drop control-pr777-mpl36.patch, upstreamed + ------------------------------------------------------------------- Fri Dec 23 20:09:25 UTC 2022 - Ben Greiner diff --git a/python-control.spec b/python-control.spec index 92010d9..ccf3e86 100644 --- a/python-control.spec +++ b/python-control.spec @@ -17,33 +17,33 @@ Name: python-control -Version: 0.9.2 +Version: 0.9.3.post2 Release: 0 Summary: Python control systems library License: BSD-3-Clause URL: https://python-control.org Source: https://files.pythonhosted.org/packages/source/c/control/control-%{version}.tar.gz Source1: %{name}-rpmlintrc -# PATCH-FIX-UPSTREAM control-pr777-mpl36.patch gh#python-control/python-control#777 -Patch1: control-pr777-mpl36.patch -BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-matplotlib Requires: python-numpy -Requires: python-scipy +Requires: python-scipy >= 1.3 Recommends: python-slycot BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module matplotlib-qt5} BuildRequires: %{python_module matplotlib} BuildRequires: %{python_module numpy} +BuildRequires: %{python_module pytest-timeout} BuildRequires: %{python_module pytest-xvfb} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module scipy} +BuildRequires: %{python_module scipy >= 1.3} BuildRequires: %{python_module slycot} BuildRequires: libjemalloc2 # /SECTION @@ -55,7 +55,7 @@ operations for analysis and design of feedback control systems. %prep %autosetup -p1 -n control-%{version} -#remove shebang +# remove shebang from testfiles which could be theoretically run standalone, but we don't do this sed -i '1{\@^#!/usr/bin/env@ d}' control/tests/*.py %build