From 51bc817134c89161116e5906fa045dae2e56e991f997cbdf84bcea53e75d378c Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Thu, 9 Jul 2020 19:18:51 +0000 Subject: [PATCH] Accepting request 819780 from home:bnavigator:branches:devel:languages:python:numeric - add pr430-numpy119delete.patch to fix test failures with new numpy OBS-URL: https://build.opensuse.org/request/show/819780 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-control?expand=0&rev=15 --- pr430-numpy119delete.patch | 29 +++++++++++++++++++++++++++++ python-control.changes | 5 +++++ python-control.spec | 5 ++--- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 pr430-numpy119delete.patch diff --git a/pr430-numpy119delete.patch b/pr430-numpy119delete.patch new file mode 100644 index 0000000..904018d --- /dev/null +++ b/pr430-numpy119delete.patch @@ -0,0 +1,29 @@ +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 d5e3f65..bbd7b7b 100644 --- a/python-control.changes +++ b/python-control.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 9 18:56:06 UTC 2020 - Benjamin Greiner + +- add pr430-numpy119delete.patch to fix test failures with new numpy + ------------------------------------------------------------------- Tue Jun 30 12:21:40 UTC 2020 - Benjamin Greiner diff --git a/python-control.spec b/python-control.spec index 4bd17bf..58f0be4 100644 --- a/python-control.spec +++ b/python-control.spec @@ -29,6 +29,7 @@ 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 @@ -57,9 +58,7 @@ operations for analysis and design of feedback control systems. %prep %setup -q -n control-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%autopatch -p1 #remove shebang sed -i '1{\@^#!/usr/bin/env python@ d}' control/tests/*.py